Upload vite.config.js
Browse files- vite.config.js +37 -0
vite.config.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { defineConfig } from "vite";
|
| 2 |
+
|
| 3 |
+
export default defineConfig({
|
| 4 |
+
base: "./",
|
| 5 |
+
build: {
|
| 6 |
+
outDir: "dist",
|
| 7 |
+
emptyOutDir: true,
|
| 8 |
+
assetsDir: "assets",
|
| 9 |
+
rollupOptions: {
|
| 10 |
+
output: {
|
| 11 |
+
// Ép đúng tên JS entry
|
| 12 |
+
entryFileNames: "assets/index-Cm1h4vpW.js",
|
| 13 |
+
// Ép đúng tên chunks (tránh sinh nhiều file lạ)
|
| 14 |
+
chunkFileNames: "assets/[name].js",
|
| 15 |
+
// Ép đúng tên CSS
|
| 16 |
+
assetFileNames: (assetInfo) => {
|
| 17 |
+
const n = assetInfo.name || "";
|
| 18 |
+
if (n.endsWith(".css")) return "assets/index-nLRMG7XC.css";
|
| 19 |
+
// giữ nguyên tên asset khác nếu có
|
| 20 |
+
return "assets/[name][extname]";
|
| 21 |
+
},
|
| 22 |
+
},
|
| 23 |
+
},
|
| 24 |
+
},
|
| 25 |
+
|
| 26 |
+
// Worker build config (để worker ra file .js đúng tên)
|
| 27 |
+
worker: {
|
| 28 |
+
format: "es",
|
| 29 |
+
rollupOptions: {
|
| 30 |
+
output: {
|
| 31 |
+
entryFileNames: "assets/[name].js",
|
| 32 |
+
chunkFileNames: "assets/[name].js",
|
| 33 |
+
assetFileNames: "assets/[name][extname]",
|
| 34 |
+
},
|
| 35 |
+
},
|
| 36 |
+
},
|
| 37 |
+
});
|