mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
fix(webpack): add exportOnlyLocals: true
for css modules options in server build. (#3778)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
02f16bf23e
commit
2bedebe5ee
@ -97,6 +97,10 @@ function createCssLoadersRule (ctx: WebpackConfigContext, cssLoaderOptions) {
|
||||
|
||||
if (options.webpack.extractCSS) {
|
||||
if (ctx.isServer) {
|
||||
// https://webpack.js.org/loaders/css-loader/#exportonlylocals
|
||||
if (cssLoader.options.modules) {
|
||||
cssLoader.options.modules.exportOnlyLocals = cssLoader.options.modules.exportOnlyLocals ?? true
|
||||
}
|
||||
return [cssLoader]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user