0
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-22 11:47:30 +01:00
uptime-kuma/config/vite.config.js

48 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-10-12 20:27:25 +02:00
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";
2021-06-24 15:42:03 +02:00
2021-10-12 20:27:25 +02:00
const postCssScss = require("postcss-scss");
const postcssRTLCSS = require("postcss-rtlcss");
2022-06-05 17:49:48 +02:00
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
2021-06-24 15:42:03 +02:00
// https://vitejs.dev/config/
export default defineConfig({
2021-08-08 18:24:05 +02:00
plugins: [
vue(),
legacy({
targets: [ "since 2015" ],
}),
visualizer({
filename: "tmp/dist-stats.html"
}),
viteCompression({
algorithm: "gzip",
2022-06-05 17:49:48 +02:00
filter: viteCompressionFilter,
}),
viteCompression({
algorithm: "brotliCompress",
2022-06-05 17:49:48 +02:00
filter: viteCompressionFilter,
}),
],
css: {
postcss: {
"parser": postCssScss,
"map": false,
2022-04-17 09:27:35 +02:00
"plugins": [ postcssRTLCSS ]
}
2021-10-12 20:27:25 +02:00
},
build: {
rollupOptions: {
output: {
manualChunks(id, { getModuleInfo, getModuleIds }) {
}
}
},
}
2021-10-12 20:27:25 +02:00
});