Does polymer build command provided by polymer-cli minifies html, css and js by default or we have to use polymer build --bundle --js-minify --css-minify --html-minify or use polymer.json for it?
Asked
Active
Viewed 194 times
0
-
No, the latest version of `polymer-cli` (`0.18.0`) does **not** perform any minification by default for the `build` command. You indeed need to use the `minify` flags or `polymer.json` to configure minification for your builds. – tony19 Apr 25 '17 at 02:15
2 Answers
0
According to the documentation, the build
command does minify the HTML, CSS and JS by default. You can however, add a build
entry to your polymer.json
file that enables you to turn off the minification and bundling if you don't want that to occur.

Ben Thomas
- 3,180
- 2
- 20
- 38
0
Yes, the newest version of polymer does support minification of html, css and js if we use the build process provided by polymer and not our own.
This only holds true for the bundled version of the build.
Using terminal we can use command like this to achieve the desired result during our build process:
polymer build --bundle --js-minify --js-compile --css-minify --html-minify --add-service-worker --verbose
and also we can minify the js,css and html in polymer.json as well like this:
"builds": [{
"bundle": true,
"js": { "minify": true },
"css": { "minify": true },
"html": { "minify": true }
}]
Thats's it.

Gaurav Singh
- 176
- 1
- 4