From 2dbc91653aab6d6cc6b3458ff862cafd1d6b70c9 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 18 Apr 2025 14:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=BB=98=E8=AE=A4=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vite.config.js b/vite.config.js index 0567692..9389f4d 100644 --- a/vite.config.js +++ b/vite.config.js @@ -23,6 +23,21 @@ export default defineConfig(({ mode, command }) => { // https://cn.vitejs.dev/config/#resolve-extensions extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] }, + // 打包配置 + build: { + // https://vite.dev/config/build-options.html + sourcemap: command === 'build' ? false : 'inline', + outDir: 'dist', + assetsDir: 'assets', + chunkSizeWarningLimit: 2000, + rollupOptions: { + output: { + chunkFileNames: 'static/js/[name]-[hash].js', + entryFileNames: 'static/js/[name]-[hash].js', + assetFileNames: 'static/[ext]/[name]-[hash].[ext]' + } + } + }, // vite 相关配置 server: { port: 80,