javascript - Google 闭包编译器和 teamcity/tfs

标签 javascript teamcity google-closure-compiler

如何让 teamcity 和/或 TFS 2010 为项目中的 js 文件运行闭包编译器。 使用闭包编译器有两个原因:

  1. 错误/警告检测

  2. 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"

关于javascript - Google 闭包编译器和 teamcity/tfs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3840644/

相关文章:

javascript - 尽管元素的 id 正确,但无法删除元素?

java - 在 WebView 在线表单中填写没有 id 的文本字段

delphi - Delphi 的 Teamcity 插件

git - 设置 TeamCity 以 pull 多个具有命名位置的 git repos

javascript - 重新格式化 javascript 以适应 google-closure-compiler 的命名空间展平

google-closure-compiler - 谷歌闭包编译过程node_modules

javascript - Jquery 插件 -toolbar.js > 链接不起作用

javascript - 使用 Number.toLocaleString() 的货币格式差异

.net - TeamCity 不会复制所有引用的库

javascript - 防止闭包编译器在不使用括号表示法的情况下重命名属性