Last active
December 15, 2015 13:19
-
-
Save jbeard4/5266451 to your computer and use it in GitHub Desktop.
Using closure compiler to stitch commonjs modules together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./lib -type d \( -path ./lib/rhino -o -path ./lib/node -o -path ./lib/browser/build \) -prune -o -name '*.js' -print | xargs java -jar ~/Downloads/compiler.jar --formatting=PRETTY_PRINT --process_common_js_modules --common_js_entry_module=lib/scion.js --output_wrapper '(function (root, scion) { if (typeof define === "function" && define.amd) { define(o); } else { root.scion = scion(); } }(this, function () { %output% return module$lib$scion;}));' > dist/combined.js | |
java -jar ~/Downloads/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS dist/combined.js > dist/out.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment