uptime-kuma/config/vite.config.js

60 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-10-12 19:27:25 +01: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";
import commonjs from "vite-plugin-commonjs";
2021-06-24 14:42:03 +01:00
2021-10-12 19:27:25 +01:00
const postCssScss = require("postcss-scss");
const postcssRTLCSS = require("postcss-rtlcss");
2022-06-05 16:49:48 +01:00
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
2021-06-24 14:42:03 +01:00
// https://vitejs.dev/config/
export default defineConfig({
2022-09-12 11:33:46 +01:00
server: {
port: 3000,
},
2022-06-28 14:55:05 +01:00
define: {
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
"DEVCONTAINER": process.env.DEVCONTAINER,
2022-06-28 14:55:05 +01:00
},
2021-08-08 17:24:05 +01:00
plugins: [
commonjs(),
2021-08-08 17:24:05 +01:00
vue(),
legacy({
targets: [ "since 2015" ],
}),
visualizer({
filename: "tmp/dist-stats.html"
}),
viteCompression({
algorithm: "gzip",
2022-06-05 16:49:48 +01:00
filter: viteCompressionFilter,
}),
viteCompression({
algorithm: "brotliCompress",
2022-06-05 16:49:48 +01:00
filter: viteCompressionFilter,
}),
],
css: {
postcss: {
"parser": postCssScss,
"map": false,
2022-04-17 08:27:35 +01:00
"plugins": [ postcssRTLCSS ]
}
2021-10-12 19:27:25 +01:00
},
build: {
commonjsOptions: {
include: [ /.js$/ ],
},
rollupOptions: {
output: {
manualChunks(id, { getModuleInfo, getModuleIds }) {
}
}
},
}
2021-10-12 19:27:25 +01:00
});