GoogleChromeLabs / critters

🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
https://npm.im/critters-webpack-plugin
Apache License 2.0
3.42k stars 108 forks source link

The css modules key styles are not inlined when configuring generateScopedName. #162

Closed Robin-front closed 4 months ago

Robin-front commented 4 months ago

I'm using @nuxt/critters in nuxt 3, but the css modules key styles are not inlined when configuring generateScopedName.

Just remove the generateScopedName configuration and everything works fine.

vite: {
        css: {
            modules: {
                generateScopedName: "[hash:base64:8]",
            },
        },
},
Robin-front commented 4 months ago

It's just passing strings to generateScopedName that can be problematic. It works fine when passing a function to generateScopedName. Probably a problem with postcss-modules.