Polymer build不创建捆绑和非捆绑文件夹

时间:2017-05-07 08:42:29

标签: polymer polymer-1.0

我不知道为什么polymer build不会在没有出现任何错误的情况下创建bundled and unbundled个文件夹。

info:    Clearing build/ directory...
info:    (default) Building...
info:    (default) Build complete!

polymer.json

{
  "entrypoint": "index.html",
  "shell": "src/good-app.html",
  "fragments": [
    "src/good-home.html",
    "src/good-list-item.html",
    "src/good-data.html",
    "src/lazy-resources.html"
  ],
  "sourceGlobs": [
   "src/**/*",
   "data/**/*",
   "images/**/*",
   "bower.json"
  ],
  "includeDependencies": [
    "manifest.json",
    "bower_components/webcomponentsjs/webcomponents-lite.min.js"
  ]
}

1 个答案:

答案 0 :(得分:3)

polymer-cli v0.18开始,您可以将“builds”添加到polymer.json。

"builds": [{
  "name": "bundled-es6",
  "bundle": true,
  "js": {"minify": true, "compile": false},
  "css": {"minify": true},
  "html": {"minify": true}
},{
  "name": "unbundled-es5",
  "bundle": false,
  "js": {"minify": true, "compile": true},
  "css": {"minify": true},
  "html": {"minify": true}
}]

https://www.polymer-project.org/2.0/docs/tools/polymer-cli#build