mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +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'
|
||||
}
|
||||
},
|
||||
css: {},
|
||||
css: {
|
||||
esModule: false
|
||||
},
|
||||
cssModules: {
|
||||
esModule: false,
|
||||
modules: {
|
||||
localIdentName: '[local]_[hash:base64:5]'
|
||||
}
|
||||
|
@ -25,11 +25,6 @@ export default class StyleLoader {
|
||||
return this.options.build.extractCSS
|
||||
}
|
||||
|
||||
get onlyLocals () {
|
||||
// Not supported anymore by css-loader
|
||||
return false // Boolean(this.isServer && this.extractCSS)
|
||||
}
|
||||
|
||||
normalize (loaders) {
|
||||
loaders = wrapArray(loaders)
|
||||
return loaders.map(loader => (typeof loader === 'string' ? { loader } : loader))
|
||||
@ -74,10 +69,11 @@ export default class StyleLoader {
|
||||
}
|
||||
|
||||
css (options) {
|
||||
options.onlyLocals = this.onlyLocals
|
||||
const cssLoader = { loader: 'css-loader', options }
|
||||
|
||||
if (options.onlyLocals) {
|
||||
if (this.isServer && this.extractCSS) {
|
||||
options.modules = options.modules || {}
|
||||
options.modules.exportOnlyLocals = true
|
||||
return [cssLoader]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user