I'm trying to minify CSS and JS files while using symfony/webpack-encore. However, I cannot find a clear answer for what I need to do. I used createSharedEntry for layouts but I need to put them into a single file eg minifying. What do I need to do? Does webpack-encore have a specific function for this or do I need to use additional plugins?
1 Answer
Symfony webpack encore is a bundle that helps you to read entrypoint.js generated by webpack. Nothing more. To minify js/css you need to learn more about Javascript/Webpack. There are a lot of tutorials and articles about it.
You could start from this course
buildcommand which creates a production build. It does not when I use thedevorwatchcommands since those are development build. Can you confirm you have the same behavior? Also, what version of webpack encore are you using?