refactor: stats none is same as false

This commit is contained in:
Clark Du 2018-03-29 15:11:34 +08:00
parent 948d56622e
commit ed321f52c1
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
3 changed files with 12 additions and 3 deletions

View File

@ -183,6 +183,10 @@ Options.from = function (_options) {
options.build.optimization.splitChunks.name = true options.build.optimization.splitChunks.name = true
} }
if (options.build.stats === 'none') {
options.build.stats = false
}
// TODO: remove when mini-css-extract-plugin supports HMR // TODO: remove when mini-css-extract-plugin supports HMR
if (options.dev) { if (options.dev) {
options.build.extractCSS = false options.build.extractCSS = false

View File

@ -7,8 +7,13 @@ let nuxt = null
describe('basic dev', () => { describe('basic dev', () => {
beforeAll(async () => { beforeAll(async () => {
const config = loadFixture('basic', { buildDir: '.nuxt-dev' }) const config = loadFixture('basic', {
config.dev = true dev: true,
buildDir: '.nuxt-dev',
build: {
stats: 'none'
}
})
nuxt = new Nuxt(config) nuxt = new Nuxt(config)
new Builder(nuxt).build() new Builder(nuxt).build()
port = await getPort() port = await getPort()

View File

@ -6,7 +6,7 @@ export const buildFixture = function buildFixture(fixture) {
test: true, test: true,
minimalCLI: true, minimalCLI: true,
build: { build: {
stats: false stats: 'errors-only'
} }
}) })
const nuxt = new Nuxt(config) const nuxt = new Nuxt(config)