From 234b6cf8944ef95c415c4898f19b8fb4d12e898f Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 13 十月 2024 22:44:46 +0800 Subject: [PATCH] 工艺路线增加完工节点 --- internal/vite-config/src/config/application.ts | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/internal/vite-config/src/config/application.ts b/internal/vite-config/src/config/application.ts index 92c6934..7ee5ef1 100644 --- a/internal/vite-config/src/config/application.ts +++ b/internal/vite-config/src/config/application.ts @@ -21,7 +21,10 @@ return defineConfig(async ({ command, mode }) => { const root = process.cwd(); const isBuild = command === 'build'; - const { VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv(mode, root); + const { VITE_PUBLIC_PATH, VITE_USE_MOCK, VITE_BUILD_COMPRESS, VITE_ENABLE_ANALYZE } = loadEnv( + mode, + root, + ); const defineData = await createDefineData(root); const plugins = await createPlugins({ @@ -35,21 +38,12 @@ const pathResolve = (pathname: string) => resolve(root, '.', pathname); const applicationConfig: UserConfig = { + base: VITE_PUBLIC_PATH, resolve: { alias: [ { find: 'vue-i18n', replacement: 'vue-i18n/dist/vue-i18n.cjs.js', - }, - // /@/xxxx => src/xxxx - { - find: /\/@\//, - replacement: pathResolve('src') + '/', - }, - // /#/xxxx => types/xxxx - { - find: /\/#\//, - replacement: pathResolve('types') + '/', }, // @/xxxx => src/xxxx { @@ -69,6 +63,8 @@ cssTarget: 'chrome80', rollupOptions: { output: { + // 鍏ュ彛鏂囦欢鍚� + entryFileNames: 'assets/entry/[name]-[hash].js', manualChunks: { vue: ['vue', 'pinia', 'vue-router'], antd: ['ant-design-vue', '@ant-design/icons-vue'], @@ -87,7 +83,7 @@ plugins, }; - const mergedConfig = mergeConfig(commonConfig, applicationConfig); + const mergedConfig = mergeConfig(commonConfig(mode), applicationConfig); return mergeConfig(mergedConfig, overrides); }); -- Gitblit v1.9.3