What's new
DevAnswe.rs Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts.

Optimal Method for Compressing and Enhancing CSS and JS Files??

Mark Tyne

New member
I'm new to compressing CSS and JS files. What's the ideal process for shrinking these files, and are there any recommended non-WordPress plugins? I've experimented with some manual minification tools, but when I revert them to a more readable format, I find some semi-colons missing. Do developers typically maintain separate files before minification and use a plugin to compress only production files?


New member
Have you tried using build tools like Gulp or Webpack.? These automate the process of minifying your files, so you don't have to do it manually. They also allow you to maintain separate development and production environments.

In your development environment, you can work with the original, unminified files. When you're ready to move to production, the build tool will automatically minify your CSS and JS files, ensuring optimal performance for your website.

To get started, you can choose a build tool (Gulp or Webpack) and follow the documentation to set up your project. You'll find various plugins for each tool that specifically handle minification, such as 'gulp-uglify' for Gulp or 'terser-webpack-plugin' for Webpack.