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

30 lines
582 B
JavaScript
Raw Normal View History

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
})
}
getBabelOptions() {
const options = clone(this.options.build.babel)
options.presets = [
[
require.resolve('@nuxt/babel-preset-app'),
{
modern: true
}
]
]
return options
}
}