Build for production not minifying app.js
See original GitHub issueVersion
3.0.1
Node and OS info
Node 10.6.0 / npm 6.4.0 / Windows 10
Steps to reproduce
- Created a new project with
vue createand chose my settings - Added some SCSS, imported, and ran
npm run build
What is expected?
Split CSS from JS, and minify everything.
What is actually happening?
CSS is still inside JS and not only the JS file app.js is not being minified, but all evals from development are still in there.
I’ve restarted my computer, deleted node_modules and reinstalled everything. Also I notice the “building for production” text is displayed, so it should be doing the right thing, yet the output app.js file is 933.61kb in size, and I only have a simple Vue Vuex setup and some CSS, nothing more.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
npm run build is not minifying the reactJs project
Hover over the extension if it says you are using production build then your files are minified. As you can see the image...
Read more >Production | webpack
In this guide, we'll dive into some of the best practices and utilities for building a production site or application.
Read more >Concatenation and Minification | Laravel Mix Documentation
So minifying app.js will generate app.min.js . Once again, the minification will only take place during a production build. ( export NODE_ENV=production )....
Read more >Production - Parcel
By default, minification is enabled when using the parcel build command. You can use the --no-optimize CLI flag to disable minification and other...
Read more >Build Targets - Vue CLI
If no entry is specified, src/App.vue will be used. A lib build outputs: ... dist/myLib.umd.min.js : Minified version of the UMD build.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You probably have a default NODE_ENV set in your shell. Delete it, or explicitly set NODE_ENV when running build.
@rowild as it turns out, @yyx990803 was right. However, on Windows, I have no idea where that would be set. That said, I added
cross-envand changed mybuildscript to:It solved my problem.