Can Closure Compiler Builds CommonJS Modules

I would like to use the Google Closure Compiler to create a CommonJS suite. Can this be done out of the box? Alternatively, is there some kind of simple conversion that can be done for CommonJS modules so that they can be used by the Closure compiler?

+6
source share
1 answer

Support has been added to the Closure Compiler to simplify work with Common JS and AMD / require.js 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 the Closure compiler.

+6
source

Source: https://habr.com/ru/post/920169/


All Articles