Compile both minified & non-minified JS/SASS files for production?
See original GitHub issueHello,
Is there a way to compile both minified and non-minified JS and SASS files for production?
For example:
- src/app.js => dist/app.js => dist/app.min.js
- src/app.scss => dist/app.css => dist/app.min.css
This would be very handy when creating packages.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Laravel Mix: Exclude SASS File from Minifying for Production
I am running Laravel 5.4 and using Laravel Mix to compile my assets. I have two SASS files for production. However, one of...
Read more >Laravel mix: how to exclude a SASS file from minifying for production
Hi folks, So I am running Laravel 5.4 and using Laravel Mix to compile my assets. I have two sass files for production,...
Read more >Laravel mix: how to exclude a SASS file from minifying?
So I am running Laravel 5.4 and using Laravel Mix to compile my assets. I have two sass files for production, however, one...
Read more >How to compile Sass files in Visual Studio and Webpack
How to compile Sass files in Visual Studio and Webpack ... Our discussion will include minification and autoprefixing for production.
Read more >SASS & SCSS Compiling/Building with Hugo and Bootstrap ...
To try and shrink that HTML file, the dash, dash minify. We'll save that and we'll check them out. So you'll see at...
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 FreeTop 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
Top GitHub Comments
Actually – after trying to modify mix to make that possible – I noticed that it is already possible. You just need the correct configuration.
Here are the required changes to webpack.mix.js in order to produce both: *.min.js and *.js. I don’t understand why, because the CustomTasksPlugin should minify the tasks’ assets nonetheless (see my research above), but somehow it doesn’t in this case:
Result: app.js (not minified) and app.min.js (minified) are created during production (
yarn run production
ornpm run production
).[EDIT] This will only work for js files. Not for scss / css.
For production I only compile a minified version with the .min suffix at the moment:
I also wanted to add a compiled, but not minified CSS and JS file to my package. In case people want to edit the CSS but don’t use mix or grunt or gulp or something. But maybe that’s not really necessary…
So what I mean is that in the end I have 3 versions of my CSS and JS:
But again, after thinking about it maybe it’s not all that useful…