Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Wraps the generated code inside UMD markers
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Jan 19, 2017
1 parent 68c5d2c commit dc262d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"browser": "./browser",
"scripts": {
"build:node": "node-gyp configure build",
"build:browser": "em++ --bind -o browser.js -O3 -std=c++14 -I src/bindings/em -I src/core -include iostream src/core/*.cc src/bindings/em/*.cc -s TOTAL_MEMORY=134217728 --memory-init-file 0",
"build:browser": "em++ --bind -o browser.js -O3 -std=c++14 -I src/bindings/em -I src/core --pre-js src/bindings/em/prologue.js --post-js src/bindings/em/epilogue.js src/core/*.cc src/bindings/em/*.cc -s TOTAL_MEMORY=134217728 --memory-init-file 0",
"build:browser:maybe": "test -f browser.js || test -n \"$CI\" || ! command -v em++ 2>&1 > /dev/null || npm run build:browser",
"build:all": "npm run build:node && npm run build:browser",
"install": "npm run build:node && npm run build:browser:maybe",
Expand Down
4 changes: 4 additions & 0 deletions src/bindings/em/epilogue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

return Module;

}));
11 changes: 11 additions & 0 deletions src/bindings/em/prologue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(function (root, factory) {

if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
window.Superstring = factory();
}

}(this, function () {

0 comments on commit dc262d5

Please sign in to comment.