2018-10-31 15:52:35 +00:00
|
|
|
import WebpackClientConfig from './client'
|
|
|
|
|
|
|
|
export default class WebpackModernConfig extends WebpackClientConfig {
|
2019-02-18 17:00:51 +00:00
|
|
|
constructor(...args) {
|
|
|
|
super(...args)
|
|
|
|
this.name = 'modern'
|
|
|
|
this.isModern = true
|
2018-10-31 15:52:35 +00:00
|
|
|
}
|
|
|
|
|
2018-12-12 09:33:19 +00:00
|
|
|
env() {
|
|
|
|
return Object.assign(super.env(), {
|
|
|
|
'process.modern': true
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-10-31 15:52:35 +00:00
|
|
|
getBabelOptions() {
|
2019-05-06 14:00:07 +00:00
|
|
|
return {
|
|
|
|
...this.buildContext.buildOptions.babel,
|
|
|
|
envName: this.name,
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
require.resolve('@nuxt/babel-preset-app'),
|
|
|
|
{
|
|
|
|
modern: true
|
|
|
|
}
|
|
|
|
]
|
2018-10-31 15:52:35 +00:00
|
|
|
]
|
2019-05-06 14:00:07 +00:00
|
|
|
}
|
2018-10-31 15:52:35 +00:00
|
|
|
}
|
|
|
|
}
|