mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat: add process.modern (#4532)
This commit is contained in:
parent
c60b1945e8
commit
f1ff6341ea
@ -30,7 +30,8 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
|
||||
'process.env.VUE_ENV': JSON.stringify('client'),
|
||||
'process.browser': true,
|
||||
'process.client': true,
|
||||
'process.server': false
|
||||
'process.server': false,
|
||||
'process.modern': false
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,16 @@ export default class WebpackModernConfig extends WebpackClientConfig {
|
||||
super(builder, { name: 'modern', isServer: false, isModern: true })
|
||||
}
|
||||
|
||||
env() {
|
||||
return Object.assign(super.env(), {
|
||||
'process.env.VUE_ENV': JSON.stringify('client'),
|
||||
'process.browser': true,
|
||||
'process.client': true,
|
||||
'process.server': false,
|
||||
'process.modern': true
|
||||
})
|
||||
}
|
||||
|
||||
getBabelOptions() {
|
||||
const options = clone(this.options.build.babel)
|
||||
|
||||
|
@ -39,7 +39,8 @@ export default class WebpackServerConfig extends WebpackBaseConfig {
|
||||
'process.env.VUE_ENV': JSON.stringify('server'),
|
||||
'process.browser': false,
|
||||
'process.client': false,
|
||||
'process.server': true
|
||||
'process.server': true,
|
||||
'process.modern': false
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user