我正在使用polymer-starter-kit项目。因为我使用的是paper-toggle-button和editor-icons.html元素。当我使用polymer serve运行我的项目时,切换按钮和edit图标会显示在浏览器中。但是,当我使用polymer build构建我的项目时,这两个组件并不包含在构建的bower_components文件夹中。以下是我的polymer.json
{
"entrypoint": "index.html",
"shell": "src/dekkho-app.html",
"fragments": [
"src/listing_page/dekkho-listing.html",
"src/home_page/dekkho-home.html",
"src/home_page/dekkho-404.html"
],
"sources": [
"src/**/*",
"images/**/*",
"bower.json",
"robots.txt"
],
"extraDependencies": [
"manifest.json",
"bower_components/webcomponentsjs/*.js"
],
"lint": {
"rules": ["polymer-2"]
},
"builds": [{
"name":"es6-supported",
"addServiceWorker": true,
"js": {"minify": true},
"css": {"minify": true},
"html": {"minify": false}
},
{
"name":"es5-supported",
"addServiceWorker": true,
"js": {"compile":true, "minify": true},
"css": {"minify": true},
"html": {"minify": false}
}
]
}提前感谢
发布于 2017-08-15 14:18:08
您的paper-toggle-button需要包含在代码库的某个地方,否则分析器找不到它。
如果它不包括在entrypoint (或其中一个依赖项)或shell (或其中一个依赖项)或fragments (或其中一个依赖项)中,那么它就不会包含在构建中--分析器认为它实际上是不需要的。
所以,要么将其包含在代码库的某个地方,要么将其作为片段添加。取决于你的需要。
https://stackoverflow.com/questions/45673967
复制相似问题