nidus-sync/vite/sync/vite.config.js

96 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import checker from "vite-plugin-checker";
import path from "path";
export default defineConfig({
plugins: [
vue(),
checker({
vueTsc: true,
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "../../ts"),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "sass:map";\n@import "@/style/variables.scss";`,
api: "modern-compiler",
silenceDeprecations: [
"import",
"global-builtin",
"if-function",
"color-functions",
],
},
},
},
build: {
manifest: false,
outDir: "static/gen/sync",
emptyOutDir: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, "./index.html"),
},
output: {
entryFileNames: "js/bundle.[hash].js",
chunkFileNames: "js/[name].[hash].js",
assetFileNames: (assetInfo) => {
if (/\.(woff2?|ttf|eot)$/.test(assetInfo.name || "")) {
return "fonts/[name].[hash][extname]";
}
if (/\.css$/.test(assetInfo.name || "")) {
return "css/style.[hash][extname]";
}
return "assets/[name].[hash][extname]";
},
},
},
sourcemap: true,
},
server: {
allowedHosts: [
"poweredge.local",
"dev-report.mosquitoes.online",
"dev-sync.nidus.cloud",
],
port: 9000,
proxy: {
"/api": {
2026-04-03 15:15:47 +00:00
target: "http://127.0.0.1:9003",
changeOrigin: false,
},
"/configuration/upload/pool/flyover": {
2026-04-03 15:15:47 +00:00
target: "http://127.0.0.1:9003",
changeOrigin: false,
},
2026-03-31 20:05:35 +00:00
"/mailer": {
2026-04-03 15:15:47 +00:00
target: "http://127.0.0.1:9003",
2026-03-31 20:05:35 +00:00
changeOrigin: false,
},
2026-04-23 00:28:31 +00:00
"/mock": {
target: "http://127.0.0.1:9003",
changeOrigin: false,
},
2026-04-23 00:28:31 +00:00
"/oauth": {
2026-04-03 15:15:47 +00:00
target: "http://127.0.0.1:9003",
2026-03-31 20:05:35 +00:00
changeOrigin: false,
},
2026-04-28 21:42:48 +00:00
"/privacy": {
target: "http://127.0.0.1:9003",
changeOrigin: false,
},
},
strictPort: true,
},
});