fix: name of vite mode support more characters

修复vite模式名称不支持下划线的问题

fixed: #1115
This commit is contained in:
无木
2021-08-24 22:51:46 +08:00
parent 56a966cfbf
commit 9f6822991c
2 changed files with 2 additions and 1 deletions

View File

@@ -50,7 +50,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
*/
function getConfFiles() {
const script = process.env.npm_lifecycle_script;
const reg = new RegExp('--mode ([a-z]+)');
const reg = new RegExp('--mode ([a-z_\\d]+)');
const result = reg.exec(script as string) as any;
if (result) {
const mode = result[1] as string;