我的polymer.json
{
"entrypoint": "index.html",
"shell": "src/boo-blogger/boo-blogger.js",
"sources": [
"images/*",
"fonts/*"
],
"extraDependencies": [
"manifest.json",
"node_modules/@webcomponents/webcomponentsjs/*.js",
"node_modules/web-animations-js/web-animations-next-lite.min.js",
"node_modules/@webcomponents/webcomponentsjs/bundles/*.js"
],
"builds": [
{
"name": "es6",
"bundle": true,
"browserCapabilities": [
"es2015",
"modules"
],
"js": {
"minify": true,
"transformModulesToAmd": true
},
"html": {
"minify": true
},
"css": {
"minify": true
},
"addServiceWorker": true
}
],
"npm": true,
"lint": {
"rules": [
"polymer-3"
]
}
}我遇到问题了
article-list.js:5 Uncaught (in promise) TypeError: _booBlogger.html$1 is not a function文章-list.js通过路由导入动态。因此,我尝试以不同的方式尝试一些构建选项。我发现在没有包的情况下构建时,构建的代码可以工作。我不知道为什么我的代码不能绑定到polymer build。如果有人好奇这个问题,并且需要完全的源代码。联系我
工具摘要
发布于 2018-07-12 13:55:37
在您的polymer.json中,需要添加:
"fragments": [
"src/article-list.js"
],发布于 2019-07-11 12:18:24
我认为您忘了在源代码中添加文章列表. to。由于它是用文档编写的,所以必须将动态导入的模块包含到polymer.json中的“源”中。请参阅https://polymer-library.polymer-project.org/3.0/docs/apps/build-for-production#dynamic
https://stackoverflow.com/questions/51168500
复制相似问题