diff --git a/packages/webpack5/src/bin/index.ts b/packages/webpack5/src/bin/index.ts index 7b63ef183..a8db8dacf 100644 --- a/packages/webpack5/src/bin/index.ts +++ b/packages/webpack5/src/bin/index.ts @@ -56,7 +56,12 @@ program env['env'] = options.env; } - env['watch'] = options.watch; + env['watch'] ??= options.watch; + + // if --env.config is passed, we'll set an environment + // variable to it's value so that the config Util + // reads from the correct config file. + process.env.NATIVESCRIPT_CONFIG_NAME ??= env['config']; const configPath = (() => { if (options.config) {