我正在使用client-dependencies-gradle插件(安装聚合物)。
clientDependencies {
bower {
'jquery'('2.0.0')
}
npm {
"@polymer/paper-checkbox"("^3.0.0-pre.12")
"@polymer/polymer"("^3.0.0-pre.12")
"@webcomponents/webcomponentsjs"("^1.2.0")
}
}
我看到安装了依赖项(即插入了diretory build / client-cache / npm / @ polymer /)。
我找不到有关如何从客户端应用程序中获取客户端依赖关系的文档。
例如,
curl localhost:8080/@webcomponents/webcomponentsjs/b6e46ee59e51fe258423440aa58327d5/webcomponents-lite.js
curl localhost:8080 / jquery / jquery.js
客户端应该在哪里看到这些文件?
答案 0 :(得分:0)
解决方案是修改spring静态内容位置的配置。我是通过将以下行添加到application.properties
来完成的。默认值为:
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
我刚刚附加了classpath:/vendor/
,以便在那里查找静态内容。
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/vendor/
/src/assets/vendor
目录映射到网址http://localhost:8080/。例如,/usr/assets/vendor/jquery/jquery.js
下安装的jquery位于http://localhost:8080/jquery/jquery.js