uptime-kuma/config/vite.config.js

58 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-10-12 11:27:25 -07:00
import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
import visualizer from "rollup-plugin-visualizer";
import viteCompression from "vite-plugin-compression";
2024-02-20 17:13:49 -08:00
import VueDevTools from "vite-plugin-vue-devtools";
2021-06-24 06:42:03 -07:00
2021-10-12 11:27:25 -07:00
const postCssScss = require("postcss-scss");
const postcssRTLCSS = require("postcss-rtlcss");
2022-06-05 08:49:48 -07:00
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
2021-06-24 06:42:03 -07:00
// https://vitejs.dev/config/
export default defineConfig({
2022-09-12 03:33:46 -07:00
server: {
port: 3000,
},
2022-06-28 06:55:05 -07:00
define: {
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
"DEVCONTAINER": JSON.stringify(process.env.DEVCONTAINER),
"GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN": JSON.stringify(process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN),
"CODESPACE_NAME": JSON.stringify(process.env.CODESPACE_NAME),
2022-06-28 06:55:05 -07:00
},
2021-08-08 09:24:05 -07:00
plugins: [
vue(),
visualizer({
filename: "tmp/dist-stats.html"
}),
viteCompression({
algorithm: "gzip",
2022-06-05 08:49:48 -07:00
filter: viteCompressionFilter,
}),
viteCompression({
algorithm: "brotliCompress",
2022-06-05 08:49:48 -07:00
filter: viteCompressionFilter,
}),
2024-02-20 17:13:49 -08:00
VueDevTools(),
],
css: {
postcss: {
"parser": postCssScss,
"map": false,
2022-04-17 00:27:35 -07:00
"plugins": [ postcssRTLCSS ]
}
2021-10-12 11:27:25 -07:00
},
build: {
commonjsOptions: {
include: [ /.js$/ ],
},
rollupOptions: {
output: {
manualChunks(id, { getModuleInfo, getModuleIds }) {
}
}
},
}
2021-10-12 11:27:25 -07:00
});