feat: add process.modern (#4532)

This commit is contained in:
Alexander Lichter 2018-12-12 09:33:19 +00:00 committed by Pooya Parsa
parent c60b1945e8
commit f1ff6341ea
3 changed files with 14 additions and 2 deletions

View File

@ -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
})
}

View File

@ -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)

View File

@ -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
})
}