diff --git a/vite.config.js b/vite.config.js index 69e06a11..5dc2dab7 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,27 +1,32 @@ -import {defineConfig} from 'vite'; -import {join} from 'path'; +import { defineConfig } from 'vite'; +import { join } from 'path'; import vue from '@vitejs/plugin-vue'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], - server:{ - port: 3002 - }, - build: { - rollupOptions: { - output: { - manualChunks(id) { - if (id.includes('node_modules')) { - return id.toString().split('node_modules/')[1].split('/')[0].toString(); - } - } - } - } - }, - resolve: { - alias: { - '@': join(__dirname, 'src'), + plugins: [vue()], + server: { + port: 3002, + }, + build: { + chunkSizeWarningLimit: 600 * 1024, // 设置警告阈值为600KiB,因为element-plus超过500kb导致打包失败 + rollupOptions: { + output: { + manualChunks(id) { + if (id.includes('node_modules')) { + return id + .toString() + .split('node_modules/')[1] + .split('/')[0] + .toString(); + } }, + }, + }, + }, + resolve: { + alias: { + '@': join(__dirname, 'src'), }, + }, });