forked from CouncilDataProject/cdp-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.app.config.js
34 lines (32 loc) · 797 Bytes
/
vite.app.config.js
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
import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://github.com/bvaughn/react-virtualized/issues/1212#issuecomment-847759202
const resolveFixup = {
name: "resolve-fixup",
setup(build) {
build.onResolve({ filter: /react-virtualized/ }, async (args) => {
return {
path: path.resolve("./node_modules/react-virtualized/dist/umd/react-virtualized.js"),
};
});
},
};
export default defineConfig({
optimizeDeps: {
esbuildOptions: {
plugins: [resolveFixup],
},
},
plugins: [
react({
// Exclude storybook stories and test
exclude: /\.(stories|test)\.(t|j)sx?$/,
// Only .tsx files
include: "src/**/*.tsx",
}),
],
build: {
outDir: "build",
},
});