2018-10-31 15:52:35 +00:00
|
|
|
import clone from 'lodash/clone'
|
|
|
|
import WebpackClientConfig from './client'
|
|
|
|
|
|
|
|
export default class WebpackModernConfig extends WebpackClientConfig {
|
|
|
|
constructor(builder) {
|
|
|
|
super(builder, { name: 'modern', isServer: false, isModern: true })
|
|
|
|
}
|
|
|
|
|
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() {
|
|
|
|
const options = clone(this.options.build.babel)
|
|
|
|
|
|
|
|
options.presets = [
|
|
|
|
[
|
|
|
|
require.resolve('@nuxt/babel-preset-app'),
|
|
|
|
{
|
|
|
|
modern: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
return options
|
|
|
|
}
|
|
|
|
}
|