nile/vite.config.js

32 lines
769 B
JavaScript
Raw Normal View History

2022-09-09 16:23:24 -04:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2024-08-09 20:17:57 -06:00
import { analyzer } from "vite-bundle-analyzer";
2022-09-09 16:23:24 -04:00
import path from "node:path";
2024-08-09 20:17:57 -06:00
const plugins = [react()];
if (process.env.USE_ANALYZER === "true") plugins.push(analyzer());
2022-09-09 16:23:24 -04:00
export default () => {
return defineConfig({
2024-08-09 20:17:57 -06:00
plugins,
2022-09-09 16:23:24 -04:00
server: {
port: process.env.VITE_DEV_PORT ?? 5173,
2022-09-09 16:23:24 -04:00
host: "0.0.0.0",
hmr: {
protocol: process.env.VITE_DEV_PROTOCOL ?? "wss",
2022-09-09 16:23:24 -04:00
},
},
build: {
outDir: "./dist",
},
resolve: {
alias: {
"@": path.resolve("./src"),
"@components": path.resolve("./src/components"),
"@images": path.resolve("./src/images"),
"@css": path.resolve("./src/css"),
2022-09-09 16:23:24 -04:00
},
},
});
};