Polymer 硫化不解析指向web-animation.js的链接
硫化橡胶1.14.7 我试图在项目中使用纸张下拉菜单。在导入到my index.html的components.html文件上使用硫化。硫化正确连接除web-animations.js文件外的所有适当文件。我在浏览器控制台中遇到以下错误Polymer 硫化不解析指向web-animation.js的链接,polymer,vulcanize,Polymer,Vulcanize,硫化橡胶1.14.7 我试图在项目中使用纸张下拉菜单。在导入到my index.html的components.html文件上使用硫化。硫化正确连接除web-animations.js文件外的所有适当文件。我在浏览器控制台中遇到以下错误 http://localhost:9005/bower_components/web-animations-js/web- animations-next-lite.min.js Failed to load resource: the serv
http://localhost:9005/bower_components/web-animations-js/web- animations-next-lite.min.js
Failed to load resource: the server responded with a status of 404 (Not Found)
此错误源于硫化文件
<script src="../../bower_components/web-animations-js/web-animations-next-lite.min.js"></script>
我正在用以下配置进行硫化
gulp.task('web_components', () =>
gulp.src(config.paths.webComponentIndex)
.pipe(vulcanize({
abspath: config.paths.dist,
excludes: [],
inlineScripts: true,
stripExcludes: false
}))
.pipe(gulp.dest(config.paths.dist))
);
config.path.dist是我的dist目录,webComponentIndex当然是绑定的输出文件,它可以正确绑定除此动画文件之外的所有内容。如果我正确理解了这个过程,那么animations.js文件应该与其他所有文件连接起来,但它没有这样做。我遇到了同样的问题,并解决了它 当硫化包括
bower\u组件\neon animation\web animations.html
和web animations.html
仅包含一个标记:
<script src="../web-animations-js/web-animations-next-lite.min.js"></script>
当您从jsinlineScripts
运行参数时,或者当您执行命令--inline scripts
此选项将用js文件内容替换脚本标记。它有助于将外部源包含到包中
您确定在bower_组件中有web动画js文件夹吗
<script src="../web-animations-js/web-animations-next-lite.min.js"></script>