network-resurrector/frontend/vite.config.mts

39 lines
955 B
TypeScript

/// <reference types="vite/client" />
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import viteTsconfigPaths from "vite-tsconfig-paths";
import eslintPlugin from "vite-plugin-eslint";
import checker from "vite-plugin-checker";
import { ensureTrailingSlash } from "./src/utils/url";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
const baseUrl = ensureTrailingSlash(env.VITE_APP_BASE_URL || "/");
return {
// depending on your application, base can also be "/"
base: baseUrl,
plugins: [
react({
jsxImportSource: "@emotion/react",
babel: {
plugins: ["@emotion/babel-plugin"]
}
}),
viteTsconfigPaths(),
eslintPlugin({
cache: false
}),
checker({ typescript: true })
],
server: {
open: true,
port: 3000
},
build: {
outDir: "build"
}
};
});