Grails asset-pipeline:引用依赖项的资产

时间:2015-07-02 21:02:05

标签: asset-pipeline grails-3.0

我正在构建一个grails应用程序,它使用来自依赖项的资产,就像它们在我自己的项目中一样。在开发模式下运行应用程序工作正常,因为没有任何文件被uglified / minified。但是,当为生产版本预处理文件时,会出现错误,因为处理器无法找到它们。

您可以在assetCompile任务的输出中看到它:

:assetCompile
...
Unable to Locate Asset: /spring-websocket.js
Unable to Locate Asset: /spring-websocket
Uglifying File 18 of 28 - application
Compressing File 18 of 28 - application
Processing File 19 of 28 - jquery-2.1.3.js
Uglifying File 19 of 28 - jquery-2.1.3
Compressing File 19 of 28 - jquery-2.1.3
Processing File 20 of 28 - my-websocket.js
Unable to Locate Asset: /spring-websocket
Uglifying File 20 of 28 - my-websocket
Compressing File 20 of 28 - my-websocket
...
Processing File 26 of 28 - sockjs.js
Uglifying File 26 of 28 - sockjs
Compressing File 26 of 28 - sockjs
Processing File 27 of 28 - spring-websocket.js
Unable to Locate Asset: /sockjs
Unable to Locate Asset: /stomp
Uglifying File 27 of 28 - spring-websocket
Compressing File 27 of 28 - spring-websocket
Processing File 28 of 28 - stomp.js
Uglifying File 28 of 28 - stomp
Compressing File 28 of 28 - stomp
Finished Precompiling Assets

所需的资产与spring-websocket(sock.js和stomp.js)捆绑在一起。您可以看到预编译器抱怨它们,但最终在最后找到它们。这些单独的文件进入最终的.war,但不进入具有我的依赖代码的缩小的application.js。资产管道是否有办法解决这个问题?

0 个答案:

没有答案