This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
vendor js/css not minified with env-prod command? #844
Closed
Description
Using the base webpack files. Running the following webpack command:
webpack --config webpack.config.vendor.js --env.prod
I'm seeing it regenerate the vendor.css and vendor.js successfully locally.
However when I open the vendor.css file I'm not seeing it minified. I also have the template published to Azure, and it's not minified there either.
What am I missing here?
Activity
etimesg commentedon Apr 5, 2017
Hello Andrew,
I believe that's expected. AFAIK
css-loader
doesn't minimize per default and I couldn't find any treatment for that inside the webpack config files. However, you can workaround this limitation by replacing the CSS rule insidewebpack.config.vendor.js
with:Please be advised that I only had time to test it using the Angular template. Perhaps someone can address whether a PR to support minified vendor.css in production is welcome and if there is a better approach to implement it.
Best,
E
aherrick commentedon Apr 5, 2017
@etimesg thanks for the response! Still getting my head wrapped around webpack but this modification makes sense.
I too am interested in any other suggestions or why it wasn't set to be minimized in Prod by default.
SteveSandersonMS commentedon Apr 7, 2017
I think it could be minified in the prod builds. That would be a nice enhancement. A pull request for that would be welcomed :)