49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import path from "path";
|
|
import { resolve } from "path";
|
|
import FullReload from "vite-plugin-full-reload";
|
|
|
|
export default defineConfig({
|
|
plugins: [FullReload(["*.html"], { delay: 200 })],
|
|
server: {
|
|
watch: {
|
|
usePolling: true,
|
|
},
|
|
hmr: {
|
|
overlay: true,
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
lucide: "lucide/dist/esm/lucide/src/lucide.js",
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 1600,
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, "index.html"),
|
|
login: resolve(__dirname, "login.html"),
|
|
register: resolve(__dirname, "register.html"),
|
|
},
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes("node_modules")) {
|
|
if (id.includes("maptiler")) {
|
|
return "maptiler";
|
|
}
|
|
if (id.includes("maplibre-gl")) {
|
|
return "maplibre";
|
|
}
|
|
if (id.includes("jquery")) {
|
|
return "jquery";
|
|
}
|
|
return "vendor";
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|