mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(build): style not work in vue
This commit is contained in:
parent
2ee86286ad
commit
dab1a831a6
@ -264,8 +264,11 @@ export default () => ({
|
|||||||
embed: 'src'
|
embed: 'src'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
css: {},
|
css: {
|
||||||
|
esModule: false
|
||||||
|
},
|
||||||
cssModules: {
|
cssModules: {
|
||||||
|
esModule: false,
|
||||||
modules: {
|
modules: {
|
||||||
localIdentName: '[local]_[hash:base64:5]'
|
localIdentName: '[local]_[hash:base64:5]'
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,6 @@ export default class StyleLoader {
|
|||||||
return this.options.build.extractCSS
|
return this.options.build.extractCSS
|
||||||
}
|
}
|
||||||
|
|
||||||
get onlyLocals () {
|
|
||||||
// Not supported anymore by css-loader
|
|
||||||
return false // Boolean(this.isServer && this.extractCSS)
|
|
||||||
}
|
|
||||||
|
|
||||||
normalize (loaders) {
|
normalize (loaders) {
|
||||||
loaders = wrapArray(loaders)
|
loaders = wrapArray(loaders)
|
||||||
return loaders.map(loader => (typeof loader === 'string' ? { loader } : loader))
|
return loaders.map(loader => (typeof loader === 'string' ? { loader } : loader))
|
||||||
@ -74,10 +69,11 @@ export default class StyleLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
css (options) {
|
css (options) {
|
||||||
options.onlyLocals = this.onlyLocals
|
|
||||||
const cssLoader = { loader: 'css-loader', options }
|
const cssLoader = { loader: 'css-loader', options }
|
||||||
|
|
||||||
if (options.onlyLocals) {
|
if (this.isServer && this.extractCSS) {
|
||||||
|
options.modules = options.modules || {}
|
||||||
|
options.modules.exportOnlyLocals = true
|
||||||
return [cssLoader]
|
return [cssLoader]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user