PurgeCSS is not enabled because you are in dev mode
See original GitHub issueHey! Thanks for your work
Looks like I missed something.
I am using Tailwind CSS and here is my nuxt config:
modules: [ 'nuxt-purgecss' ],
purgeCSS: {
mode: 'postcss',
whitelist: ['html', 'body', 'nuxt-progress', 'is-active']
},
build: {
extractCSS: true,
postcss: {
plugins: {
tailwindcss: './tailwind.config.js',
autoprefixer: {}
}
}
...
I got “PurgeCSS is not enabled because you are in dev mode” regardless yarn dev or yarn build command I am using
What I am doing wrong? Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
nuxt-purgecss - npm
Start using nuxt-purgecss in your project by running `npm i nuxt-purgecss`. ... false (Disabled during nuxt dev , enabled otherwise).
Read more >nuxt-purgecss with mdb-vue not working in production
With my current working nuxt.config.js(see below). I test in dev mode "npm run dev" and css is not purged(what I want). then I...
Read more >The build Property - Nuxt
Nuxt lets you customize the webpack configuration for building your web application as you want.
Read more >Optimizing CSS with PurgeCSS | Warren Lee
When you are ready go ahead and install the nuxt purgecss module to your nuxt app. ... or `false` when in dev/debug mode...
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 Free
Top 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
I had the same problem. i got the “PurgeCSS is not enabled because you are in dev mode” on my remote app using CleverCloud. Of course I set up DEBUG to true and all env variables to production, but I was always getting an error saying I was in Dev mode… but I was in production. I think the error message is misleading because it check if (typeof purgeCSS.enabled === ‘undefined’) but that doesn’t mean we are in dev mode right ? I think the problem come from the enabled option with " ({ isDev, isClient }) => (!isDev && isClient) ". It doesn’t seem to work anymore. I was getting “undefined” while testing.
For people stuck like me, I ended up setting the enabled option in nuxt.config.js with one of my env variable.
I was able to fix the issue by upgrading all dependencies, not sure which one was causing the problem…