39 lines
No EOL
791 B
TypeScript
39 lines
No EOL
791 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import path from "path";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => ({
|
|
server: {
|
|
host: "::",
|
|
port: 8080,
|
|
},
|
|
base: "/",
|
|
build: {
|
|
outDir: "dist",
|
|
assetsDir: "assets",
|
|
sourcemap: false,
|
|
minify: 'esbuild',
|
|
target: 'es2015',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: undefined,
|
|
entryFileNames: `assets/[name].[hash].js`,
|
|
chunkFileNames: `assets/[name].[hash].js`,
|
|
assetFileNames: `assets/[name].[hash].[ext]`,
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
esbuild: {
|
|
target: 'es2015',
|
|
format: 'esm'
|
|
}
|
|
})); |