Hello Everyone,
I just want to share my results after so many failed attempts to integrate purgecss with webpack. I only managed to make it work after the build, so this is my idea:
- install purgecss globally
npm install -g purgecss
- add purgecss --config ./purgecss.config.js in the scripts after the build
"scripts": {
"build": "quasar build && purgecss --config ./purgecss.config.js"
}
- make a purgecss.config.js file and just whitelist what I need
module.exports = {
content: ["./dist/spa/js/*.js"],
css: ["./dist/spa/css/*.css"],
output: ["./dist/spa/css/"],
fontFace: true,
keyframes: true,
variables: true,
rejected: true,
safelist: {
standard: [/fixed-.*/, /absolute-.*/, /q-btn.*/, /justify-.*/]
}
};
Thats it…