Nuxt/packages/webpack/src/config/modern.js

31 lines
572 B
JavaScript
Raw Normal View History

import WebpackClientConfig from './client'
export default class WebpackModernConfig extends WebpackClientConfig {
constructor(...args) {
super(...args)
this.name = 'modern'
this.isModern = true
}
2018-12-12 09:33:19 +00:00
env() {
return Object.assign(super.env(), {
'process.modern': true
})
}
getBabelOptions() {
return {
...this.buildContext.buildOptions.babel,
envName: this.name,
presets: [
[
require.resolve('@nuxt/babel-preset-app'),
{
modern: true
}
]
]
}
}
}