[英]How do I use the Google Closure Compiler to build one file?
The question is a little more complicated than the title suggests, so allow me to elaborate. 这个问题比标题所暗示的要复杂一些,所以请允许我详细说明。 I have a project that is split into two repositories. 我有一个项目,该项目分为两个存储库。 The both use Google Closure for dependency management and compilation. 两者都使用Google Closure进行依赖项管理和编译。 I need to deliver a compiled version of project A to project B. Project B does advanced optimizations, so project A must be whitespace only. 我需要将项目A的编译版本交付给项目B。项目B进行了高级优化,因此项目A必须仅是空格。 The problem is that I can't find a way to satisfy all my requirements for compiled A, which are: 问题是我找不到满足我对已编译A的所有要求的方法,这些要求是:
goog
base code, ie, var goog=goog||{}...
不能有goog
基本代码,即var goog=goog||{}...
So far I've tried: 到目前为止,我已经尝试过:
Has anyone made a similar setup work? 有人进行过类似的设置工作吗?
I solved it by getting the dependencies from closurebuilder.py and simply concatenating them together, in order, into one file. 我通过从closurebuilder.py获取依赖项并将其按顺序简单地串联在一起,从而解决了一个文件。 It gets shipped to a built repo, where B can pick it up via npm, and it gets run through a closure script (that adv. optimizes it and splits it into modules). 它被运送到一个内置的仓库中,B可以在其中通过npm将其拾起,并通过一个闭包脚本运行(该脚本会对其进行优化并将其拆分为模块)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.