Skip to content

Commit 3caf070

Browse files
author
piexlMax(奇淼
committed
优化打包
1 parent 1e24bbc commit 3caf070

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

web/vite.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import legacyPlugin from '@vitejs/plugin-legacy'
22
import AutoImport from 'unplugin-auto-import/vite'
33
import Components from 'unplugin-vue-components/vite'
44
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
5-
import { viteLogo } from './src/core/config'
5+
import { viteLogo } from '@/core/config'
66
import Banner from 'vite-plugin-banner'
77
import * as path from 'path'
88
import * as dotenv from 'dotenv'
@@ -40,6 +40,14 @@ export default ({
4040

4141
const esbuild = {}
4242

43+
const rollupOptions = {
44+
output: {
45+
entryFileNames: '087AC4D233B64EB0[name].js',
46+
chunkFileNames: '087AC4D233B64EB0[name].js',
47+
assetFileNames: '087AC4D233B64EB0[name].[ext]',
48+
},
49+
}
50+
4351
const config = {
4452
base: './', // index.html文件所在位置
4553
root: './', // js导入的资源路径,src
@@ -68,7 +76,7 @@ export default ({
6876
manifest: false, // 是否产出manifest.json
6977
sourcemap: false, // 是否产出sourcemap.json
7078
outDir: 'dist', // 产出目录
71-
// rollupOptions,
79+
rollupOptions,
7280
},
7381
esbuild,
7482
optimizeDeps,

0 commit comments

Comments
 (0)