27 lines
843 B
TypeScript
27 lines
843 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
import rollupNodePolyfillsPlugin from "rollup-plugin-polyfill-node";
|
|
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
|
|
import { NodeModulesPolyfillPlugin } from "@esbuild-plugins/node-modules-polyfill";
|
|
import { manifest } from "./build/manifestPlugin";
|
|
|
|
const config = defineConfig({
|
|
plugins: [manifest(), tsconfigPaths(), react(), rollupNodePolyfillsPlugin()],
|
|
resolve: {
|
|
alias: {
|
|
events: "rollup-plugin-node-polyfills/polyfills/events",
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
plugins: [
|
|
NodeGlobalsPolyfillPlugin({ buffer: true, process: true }),
|
|
NodeModulesPolyfillPlugin(),
|
|
],
|
|
},
|
|
},
|
|
});
|
|
|
|
export default config;
|