提交 b9e4506e 编写于 作者: fxy060608's avatar fxy060608

fix: 修复 cli工程在HBuilderX中被传入UNI_INPUT_DIR导致 VITE_ROOT_DIR 不正确,引发编译报错

上级 54cf4a89
......@@ -116,8 +116,12 @@ export function initEnv(
process.env.UNI_SUB_PLATFORM = options.platform
options.platform = 'quickapp-webview'
}
process.env.VITE_ROOT_DIR =
process.env.VITE_ROOT_DIR || process.env.UNI_INPUT_DIR || process.cwd()
if (isInHBuilderX()) {
process.env.VITE_ROOT_DIR =
process.env.VITE_ROOT_DIR || process.env.UNI_INPUT_DIR || process.cwd()
} else {
process.env.VITE_ROOT_DIR = process.env.VITE_ROOT_DIR || process.cwd()
}
process.env.UNI_INPUT_DIR =
process.env.UNI_INPUT_DIR || path.resolve(process.cwd(), 'src')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册