fix: Fixed a bug that caused mode to be ignored if run together with watch (#1700)

* fix: Fixed a bug that caused —mode to be ignored if run together with —watch

* fix: Moved the paren that caused the expression to evaluate wrongly
This commit is contained in:
Michael Wolthers Nielsen
2018-06-29 00:35:30 +02:00
committed by Guillaume Chau
parent e2a7063c9f
commit 1b1a89fd43
+2 -2
View File
@@ -157,8 +157,8 @@ module.exports = class Service {
async run (name, args = {}, rawArgv = []) {
// resolve mode
// prioritize inline --mode
// fallback to resolved default modes from plugins
const mode = name === 'build' && args.watch ? 'development' : args.mode || this.modes[name]
// fallback to resolved default modes from plugins or development if --watch is defined
const mode = args.mode || (name === 'build' && args.watch ? 'development' : this.modes[name])
// load env variables, load user config, apply plugins
this.init(mode)