Created
March 18, 2015 14:01
-
-
Save swannodette/8840c2dcedd32a8fbef6 to your computer and use it in GitHub Desktop.
Closure CommonJS Transform
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
| function woz(a, b) { | |
| return wozwoz(a, b); | |
| }; | |
| module.exports = { | |
| woz: woz | |
| }; |
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
| closure --common_js_entry_module foo.js --process_common_js_modules \ | |
| --compilation_level WHITESPACE_ONLY --formatting PRETTY_PRINT --js_output_file out.js foo.js baz.js |
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
| var baz = require("baz"); | |
| function foo(a, b) { | |
| return baz.woz(a, b); | |
| }; | |
| module.exports = { | |
| foo: foo | |
| }; |
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
| goog.provide("module$baz"); | |
| function woz$$module$baz(a, b) { | |
| return wozwoz(a, b); | |
| } | |
| var module$baz = {woz:woz$$module$baz}; | |
| goog.provide("module$foo"); | |
| goog.require("module$baz"); | |
| var baz$$module$foo = module$baz; | |
| function foo$$module$foo(a, b) { | |
| return baz$$module$foo.woz(a, b); | |
| } | |
| var module$foo = {foo:foo$$module$foo}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I assume bar.js should probably be baz.js?