1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-26 22:56:52 +02:00
uptime-kuma/config/vite.config.js
Louis Lam e773e454e9
Some checks failed
Auto Test / check-linters (push) Failing after 44s
Auto Test / auto-test (18, ARM64) (push) Has been skipped
Auto Test / auto-test (18, macos-latest) (push) Has been skipped
Auto Test / auto-test (18, ubuntu-latest) (push) Has been skipped
Auto Test / auto-test (18, windows-latest) (push) Has been skipped
Auto Test / auto-test (20, ARM64) (push) Has been skipped
Auto Test / auto-test (20, macos-latest) (push) Has been skipped
Auto Test / auto-test (20, ubuntu-latest) (push) Has been skipped
Auto Test / auto-test (20, windows-latest) (push) Has been skipped
CodeQL / Analyze (go) (push) Failing after 23s
CodeQL / Analyze (javascript-typescript) (push) Failing after 20s
Merge Conflict Labeler / Labeling (push) Has been skipped
json-yaml-validate / json-yaml-validate (push) Successful in 7s
Auto Test / armv7-simple-test (18, ARMv7) (push) Has been cancelled
Auto Test / armv7-simple-test (20, ARMv7) (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
Automatically close stale issues / stale (push) Successful in 9s
Fix #5157 and cleanup some devcontainer code (#5162)
2024-10-07 19:06:28 +08:00

56 lines
1.4 KiB
JavaScript

import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
import visualizer from "rollup-plugin-visualizer";
import viteCompression from "vite-plugin-compression";
import VueDevTools from "vite-plugin-vue-devtools";
const postCssScss = require("postcss-scss");
const postcssRTLCSS = require("postcss-rtlcss");
const viteCompressionFilter = /\.(js|mjs|json|css|html|svg)$/i;
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3000,
},
define: {
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
"process.env": {},
},
plugins: [
vue(),
visualizer({
filename: "tmp/dist-stats.html"
}),
viteCompression({
algorithm: "gzip",
filter: viteCompressionFilter,
}),
viteCompression({
algorithm: "brotliCompress",
filter: viteCompressionFilter,
}),
VueDevTools(),
],
css: {
postcss: {
"parser": postCssScss,
"map": false,
"plugins": [ postcssRTLCSS ]
}
},
build: {
commonjsOptions: {
include: [ /.js$/ ],
},
rollupOptions: {
output: {
manualChunks(id, { getModuleInfo, getModuleIds }) {
}
}
},
}
});