theazureshadow
theazureshadow

Reputation: 10049

Can Closure Compiler build CommonJS modules

I would like to use Google Closure Compiler to build a set of CommonJS modules. Can this be done out of the box? Alternatively, is there some simple transformation that can be done to the CommonJS modules to allow them to be consumed by Closure Compiler?

Upvotes: 8

Views: 5067

Answers (1)

Christopher Peisert
Christopher Peisert

Reputation: 24094

Support has been added to Closure Compiler to make it is easier to work with Common JS and AMD/require.js modules using the following compiler flags:

  • --transform_amd_modules
  • --process_common_js_modules
  • --common_js_entry_module
  • --common_js_module_path_prefix

See Experimental support for Common JS and AMD/require.js modules in Closure Compiler

Upvotes: 6

Related Questions