mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-24 10:06:41 +00:00
32 lines
591 B
JavaScript
32 lines
591 B
JavaScript
import clone from 'lodash/clone'
|
|
import WebpackClientConfig from './client'
|
|
|
|
export default class WebpackModernConfig extends WebpackClientConfig {
|
|
constructor(...args) {
|
|
super(...args)
|
|
this.name = 'modern'
|
|
this.isModern = true
|
|
}
|
|
|
|
env() {
|
|
return Object.assign(super.env(), {
|
|
'process.modern': true
|
|
})
|
|
}
|
|
|
|
getBabelOptions() {
|
|
const options = clone(this.buildContext.buildOptions.babel)
|
|
|
|
options.presets = [
|
|
[
|
|
require.resolve('@nuxt/babel-preset-app'),
|
|
{
|
|
modern: true
|
|
}
|
|
]
|
|
]
|
|
|
|
return options
|
|
}
|
|
}
|