親愛的全部, 我需要使用Shrinksafe將一個文件夾內的所有JavaScript文件合併到一個文件中。 我正在使用以下ANT腳本。但是這不能正常工作。使用Shrinksafe合併JS文件
<!-- 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
有人可以請指導我解決這個問題。
你有你的JSLinted JS代碼?你確定它沒有錯誤嗎? – mrtom 2011-03-28 17:33:13
jslib/buildUtils.js是Dojo Toolkit中的標準構建腳本。我可以證明它沒有JavaScript語法錯誤。 – 2011-03-29 06:03:24