Bundle dayjs locales together
This commit is contained in:
parent
4bbb48dce5
commit
13b87cd82a
@ -1,4 +1,3 @@
|
|||||||
import { fileURLToPath, URL } from "node:url";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import vue from "@vitejs/plugin-vue";
|
import vue from "@vitejs/plugin-vue";
|
||||||
@ -53,9 +52,16 @@ export default defineConfig(({ command }) => {
|
|||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
index: fileURLToPath(
|
index: path.resolve(__dirname, "./public/index.html"),
|
||||||
new URL(`./public/index.html`, import.meta.url)
|
},
|
||||||
),
|
output: {
|
||||||
|
manualChunks: (id) => {
|
||||||
|
// bundle dayjs files in a single chunk
|
||||||
|
// this avoids having small files for each locale
|
||||||
|
if (id.includes("dayjs/")) {
|
||||||
|
return "dayjs";
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user