2016-03-06 52 views
2

硫化1.14.7硫化不解决链接到web-animation.js

我试图在项目中使用纸张下拉菜单。在导入到我的index.html中的components.html文件中使用vulcanize。 Vulcanize正确连接除web-animations.js文件以外的所有适当文件。在浏览器控制台中出现以下错误。

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> 

只是定义为不透明的动画

Polymer({ 

is: 'opaque-animation', 

我与一饮而尽硫化用下面的配置

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.paths.dist以上是我的DIST目录和webComponentIndex当然是捆绑的捆绑输出文件正确的是这个动画文件。如果我正确理解这个过程,那animations.js文件应该与其他所有内容一起连接起来,但它并没有这样做。

回答

0

我有同样的问题,并解决它。

出现此问题时,硫化包括bower_components\neon-animation\web-animations.html

而且web-animations.html仅包含一个标签:

<script src="../web-animations-js/web-animations-next-lite.min.js"></script> 

所有你需要的时候,你从JS inlineScripts运行它,或者把参数到你的硫化当你执行命令--inline-scripts

此选项将用js文件内容替换脚本标记。这有助于将外部资源包含在一个包中。

您确定您有bower_components中的web-animations-js文件夹吗?