【发布时间】:2014-12-04 18:10:19
【问题描述】:
由于这条消息,我正在尝试从closurebuilder.py 脚本迁移到Closure compiler:
../../closure-library/closure/bin/build/closurebuilder.py: Closure Compiler now natively understands and orders Closure dependencies and
优于使用此脚本执行 JavaScript 编译
由于我使用Google Closure Library和OpenLayers 3,我如何调用编译器(compiler.jar)来
- 构建一个 myapp-deps.js 依赖文件
- 构建一个缩小版 myapp.js,其中仅包含使用过的 OL3 和 CL 类
- 使用预先计算好的 OL3 和 CL 依赖文件(例如 ol3-deps.js)进行构建
让我们进一步说一切都位于以下结构中。这几乎相当于我自己的项目,但它太大而复杂,直接在这里发布。
project/
src/
js/
<some other js "required" in myapp.js>
myapp.js
myapp-deps.js # This should be the dependency file
lib/
closure/goog/...
third_party/closure/goog/...
myapp.js # This should be the minified version
ol3/
感谢每一个提示。
【问题讨论】:
标签: javascript google-closure-compiler google-closure google-closure-library