-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
35 lines (34 loc) · 1.16 KB
/
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
33
34
35
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vite.dev/config/
export default defineConfig({
// per https://stackoverflow.com/questions/74518887/blank-page-when-deploying-a-react-app-to-github-pages-and-vite
base: "/wave.js/",
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: 3002,
},
build: {
outDir: "build",
rollupOptions: {
// external: ["src/app.jsx"], // Exclude app.jsx from the bundle
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: "main.[ext]", // Optional: Name for assets like CSS or images
},
},
},
});