作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
亲爱的大家,我需要使用 Shrinksafe 将一个文件夹内的所有 JavaScript 文件合并到一个文件中。我正在使用以下 ANT 脚本。但这并不能正常工作。
<!-- Merge the JS files in scripts folder to a single file-->
<target name="mergegp-js">
<echo message="Starting Merging"/>
<java fork="true" dir="${shrinksafe.util.path}/buildscripts" classname="org.mozilla.javascript.tools.shell.Main">
<classpath>
<pathelement location="${shrinksafe.util.path}/shrinksafe/js.jar"/>
<pathelement location="${shrinksafe.util.path}/shrinksafe/shrinksafe.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg value="build.js"/>
<arg value="${merged.gpstatic.folder}/test/scripts/*.js > tempMerged.js"/>
</java>
<echo message="js build successfull." />
</target>
但是上面的脚本给了我以下错误。
[java] js: "jslib/buildUtil.js", line 1168: exception from uncaught JavaScript throw: Malformed name/value pair: [C:/Test/scripts/*.js]. Format should be name=value
有人可以指导我解决这个问题吗?
最佳答案
build.js
的参数应采用 name=value
格式。例如,profile=standard action=release
。您需要更改参数的语法以匹配格式。所以
<arg value="build.js"/>
应该是这样的:
<arg value="profile=standard action=release" />
关于javascript - 使用 Shrinksafe 合并 JS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5456760/
亲爱的大家,我需要使用 Shrinksafe 将一个文件夹内的所有 JavaScript 文件合并到一个文件中。我正在使用以下 ANT 脚本。但这并不能正常工作。
在尝试使用 Shrinksafe custom_rhino.jar 构建 Dojo 时,我收到 MalformedInputException。当构建到达包含以 UTF-8 存储的法语字母的自定义小部
当我尝试通过 ShrinkSafe 缩小我的 Javascript 文件时,一个很棒的缩小工具,它输出一个空文件,这意味着我的 Javascript 文件显然包含一个错误,尽管在五个浏览器中一切都完美
我是一名优秀的程序员,十分优秀!