This commit is contained in:
ahjung
2024-09-14 22:39:11 +08:00
parent 1ae5372396
commit 7a62de39c2
62 changed files with 1996 additions and 2938 deletions

View File

@@ -22,9 +22,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
const root = process.cwd();
const env = loadEnv(mode, root);
const viteEnv = wrapperEnv(env);
const { VITE_PUBLIC_PATH, VITE_PORT, VITE_GLOB_PROD_MOCK, VITE_PROXY } =
viteEnv;
const prodMock = VITE_GLOB_PROD_MOCK;
const { VITE_PUBLIC_PATH, VITE_PORT, VITE_PROXY } = viteEnv;
const isBuild = command === 'build';
return {
base: VITE_PUBLIC_PATH,
@@ -42,9 +40,11 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
],
dedupe: ['vue'],
},
plugins: createVitePlugins(viteEnv, isBuild, prodMock),
plugins: createVitePlugins(viteEnv, isBuild),
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
__APP_INFO__: JSON.stringify(__APP_INFO__),
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
},
server: {
host: true,