Skip to content

Commit 1b1a89f

Browse files
wolthersAkryum
authored andcommitted
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
1 parent e2a7063 commit 1b1a89f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@vue/cli-service/lib/Service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ module.exports = class Service {
157157
async run (name, args = {}, rawArgv = []) {
158158
// resolve mode
159159
// prioritize inline --mode
160-
// fallback to resolved default modes from plugins
161-
const mode = name === 'build' && args.watch ? 'development' : args.mode || this.modes[name]
160+
// fallback to resolved default modes from plugins or development if --watch is defined
161+
const mode = args.mode || (name === 'build' && args.watch ? 'development' : this.modes[name])
162162

163163
// load env variables, load user config, apply plugins
164164
this.init(mode)

0 commit comments

Comments
 (0)