From f6dfae4585230de171ef7eb7ba2716c569a72db9 Mon Sep 17 00:00:00 2001 From: mozzie Date: Tue, 21 Mar 2023 11:22:25 +0800 Subject: [PATCH] reafctor: vite.config.js --- apps/web/stats.html | 6177 +++++++++++++++++++++++++++++++++++++++ apps/web/vite.config.ts | 23 +- 2 files changed, 6187 insertions(+), 13 deletions(-) create mode 100644 apps/web/stats.html diff --git a/apps/web/stats.html b/apps/web/stats.html new file mode 100644 index 0000000..80819d4 --- /dev/null +++ b/apps/web/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 5fa9e1f..e80b5ce 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -26,18 +26,15 @@ export default defineConfig({ }, }, build: { - // rollupOptions: { - // output: { - // manualChunks(id) { - // if (id.includes("node_modules")) { - // return id - // .toString() - // .split("node_modules/")[1] - // .split("/")[0] - // .toString(); - // } - // }, - // }, - // }, + rollupOptions: { + output: { + // 入口文件名 + entryFileNames: "assets/[hash].js", + // 块文件名 + chunkFileNames: "assets/[hash].js", + // 资源文件名 css 图片等等 + assetFileNames: "assets/[hash].[ext]", + }, + }, }, });