0

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?

2
  • github.com/symfony/webpack-encore/blob/master/lib/plugins/… Commented Nov 13, 2020 at 11:29
  • 1
    For me, webpack encore minifies my files automatically when using the build command which creates a production build. It does not when I use the dev or watch commands since those are development build. Can you confirm you have the same behavior? Also, what version of webpack encore are you using? Commented Nov 15, 2020 at 6:29

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.