[英]Vulcanize does not resolve link to web-animation.js
硫化1.14.7
我正在嘗試在項目中使用paper-dropdown菜單。 在導入到我的index.html中的components.html文件上使用硫化。 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進行硫化
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文件與其他所有文件串聯在一起,但是它沒有這樣做。
我有同樣的問題並解決了。
硫化包括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
時,只需將參數放入vulcanize
此選項將用js文件內容替換腳本標簽。 而且它有助於將外部資源包含到捆綁軟件中。
您確定bower_components中有web-animations-js文件夾嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.