【发布时间】:2012-07-10 22:13:27
【问题描述】:
我想使用Google Closure Compiler 来构建一组CommonJS 模块。这可以开箱即用吗?或者,是否可以对 CommonJS 模块进行一些简单的转换以允许它们被 Closure Compiler 使用?
【问题讨论】:
标签: javascript build-process google-closure-compiler commonjs
我想使用Google Closure Compiler 来构建一组CommonJS 模块。这可以开箱即用吗?或者,是否可以对 CommonJS 模块进行一些简单的转换以允许它们被 Closure Compiler 使用?
【问题讨论】:
标签: javascript build-process google-closure-compiler commonjs
已向 Closure Compiler 添加了支持,以便使用以下编译器标志更轻松地使用 Common JS 和 AMD/require.js 模块:
--transform_amd_modules--process_common_js_modules--common_js_entry_module--common_js_module_path_prefix见Experimental support for Common JS and AMD/require.js modules in Closure Compiler
【讨论】:
package.json,所以目前看来不支持。
--process_common_js_modules 产生goog.provide("module$index") 语句,需要通过closurebuilder等来构建。