mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-07 22:07:01 +08:00
Page Loading Speed Optimization (#1711)
* Update Vite.js to 2.9.9 and add Rollup Plugin Visualizer * Prebuild gzip and brotli for assets Original: ~1.2MB Optimized: ~370KB
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import legacy from "@vitejs/plugin-legacy";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { defineConfig } from "vite";
|
||||
import visualizer from "rollup-plugin-visualizer";
|
||||
import viteCompression from "vite-plugin-compression";
|
||||
|
||||
const postCssScss = require("postcss-scss");
|
||||
const postcssRTLCSS = require("postcss-rtlcss");
|
||||
@@ -12,7 +14,16 @@ export default defineConfig({
|
||||
legacy({
|
||||
targets: [ "ie > 11" ],
|
||||
additionalLegacyPolyfills: [ "regenerator-runtime/runtime" ]
|
||||
})
|
||||
}),
|
||||
visualizer({
|
||||
filename: "tmp/dist-stats.html"
|
||||
}),
|
||||
viteCompression({
|
||||
algorithm: "gzip",
|
||||
}),
|
||||
viteCompression({
|
||||
algorithm: "brotliCompress",
|
||||
}),
|
||||
],
|
||||
css: {
|
||||
postcss: {
|
||||
@@ -21,4 +32,13 @@ export default defineConfig({
|
||||
"plugins": [ postcssRTLCSS ]
|
||||
}
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id, { getModuleInfo, getModuleIds }) {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user