Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使 teamcity 和/或 TFS 2010 为项目中的 js 文件运行闭包编译器。使用闭包编译器有两个原因:
错误/警告检测
js 缩小/混淆 - 可选
我们使用 rake 构建和 TeamCity。它调用闭包来编译和缩小我们所有的 javascript,作为安装程序打包的一部分。
它在 rake 中非常简单,只需使用 sh 执行以下操作:
sh "java -jar #{JS_TOOLS_DIR}/google-closure.jar --js=#{js_file} --js_output_file=#{min_file} " + "--warning_level QUIET --compilation_level WHITESPACE_ONLY"