-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvite.config.ts
32 lines (31 loc) · 977 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vite.dev/config/
export default defineConfig({
plugins: [
react({
jsxImportSource: "@emotion/react",
babel: {
plugins: ["@emotion/babel-plugin"],
},
}),
nodePolyfills(),
],
define: {
__dirname: JSON.stringify(__dirname), // fix for node.js modules in client bundle
},
server: {
port: 3001,
},
build: {
outDir: "build",
rollupOptions: {
output: {
entryFileNames: "main.js", // Name the main output bundle as main.js
chunkFileNames: "[name]-[hash].js", // Optional: Name for dynamic imports or shared chunks
assetFileNames: "[name]-[hash].[ext]", // Optional: Name for assets like CSS or images
},
},
},
});