mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
refactor: move babel defaults value to Options.defaults
This commit is contained in:
parent
97a6f46507
commit
f9d2bce5af
@ -177,14 +177,7 @@ module.exports = class Builder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBabelOptions({ isServer }) {
|
getBabelOptions({ isServer }) {
|
||||||
const options = _.defaults(
|
const options = _.clone(this.options.build.babel)
|
||||||
{},
|
|
||||||
this.options.build.babel,
|
|
||||||
{
|
|
||||||
babelrc: false,
|
|
||||||
cacheDirectory: !!this.options.dev
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (typeof options.presets === 'function') {
|
if (typeof options.presets === 'function') {
|
||||||
options.presets = options.presets({ isServer })
|
options.presets = options.presets({ isServer })
|
||||||
|
@ -119,6 +119,11 @@ Options.from = function (_options) {
|
|||||||
options.build.cssSourceMap = options.dev
|
options.build.cssSourceMap = options.dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// babel cacheDirectory
|
||||||
|
if (options.build.babel.cacheDirectory === undefined) {
|
||||||
|
options.build.babel.cacheDirectory = options.dev
|
||||||
|
}
|
||||||
|
|
||||||
// Debug errors
|
// Debug errors
|
||||||
if (options.debug === undefined) {
|
if (options.debug === undefined) {
|
||||||
options.debug = options.dev
|
options.debug = options.dev
|
||||||
@ -210,7 +215,9 @@ Options.defaults = {
|
|||||||
styleResources: {},
|
styleResources: {},
|
||||||
vendor: [],
|
vendor: [],
|
||||||
plugins: [],
|
plugins: [],
|
||||||
babel: {},
|
babel: {
|
||||||
|
babelrc: false
|
||||||
|
},
|
||||||
postcss: {},
|
postcss: {},
|
||||||
templates: [],
|
templates: [],
|
||||||
watch: [],
|
watch: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user