feat: options.minimalCLI

This commit is contained in:
Pooya Parsa 2018-03-21 09:50:14 +03:30
parent 55dd9e76e2
commit f2e26b3c04
5 changed files with 15 additions and 9 deletions

View File

@ -40,7 +40,7 @@ export default class Builder {
this.filesWatcher = null
this.customFilesWatcher = null
this.spinner = createSpinner({
minimal: this.options.test || this.options.ci
minimal: this.options.minimalCLI
})
// Mute stats on dev

View File

@ -21,7 +21,7 @@ export default class Generator {
)
this.spinner = createSpinner({
minimal: this.options.test || this.options.ci
minimal: this.options.minimalCLI
})
}

View File

@ -132,7 +132,7 @@ export default function webpackBaseConfig({ name, isServer }) {
if (this.options.build.profile) {
config.plugins.push(new webpack.ProgressPlugin({ profile: true }))
} else {
if (!(this.options.test || this.options.ci)) {
if (!(this.options.minimalCLI)) {
config.plugins.push(new ProgressPlugin({
spinner: this.spinner,
name: isServer ? 'server' : 'client',

View File

@ -4,9 +4,10 @@ import isCI from 'is-ci'
export default {
// Information about running environment
dev: process.env.NODE_ENV !== 'production',
debug: undefined, // Will be equal to dev if not provided
debug: undefined, // = dev
test: process.env.NODE_ENV === 'test',
ci: Boolean(isCI),
minimalCLI: undefined, // = ci || test || !dev
// Mode
mode: 'universal',

View File

@ -121,6 +121,16 @@ Options.from = function (_options) {
)
}
// Debug errors
if (options.debug === undefined) {
options.debug = options.dev
}
// minimalCLI
if (options.minimalCLI === undefined) {
options.minimalCLI = options.ci || options.test || !options.dev
}
// Apply default hash to CSP option
if (options.render.csp === true) {
options.render.csp = { hashAlgorithm: 'sha256' }
@ -136,11 +146,6 @@ Options.from = function (_options) {
options.build.babel.cacheDirectory = options.dev
}
// Debug errors
if (options.debug === undefined) {
options.debug = options.dev
}
// Resource hints
if (options.render.resourceHints === undefined) {
options.render.resourceHints = !options.dev