33 lines
663 B
JavaScript
33 lines
663 B
JavaScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import GlobalsPolyfills from "@esbuild-plugins/node-globals-polyfill";
|
|
import NodeModulesPolyfills from "@esbuild-plugins/node-modules-polyfill";
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: "./",
|
|
plugins: [vue()],
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
plugins: [
|
|
NodeModulesPolyfills(),
|
|
GlobalsPolyfills({
|
|
process: true,
|
|
buffer: true,
|
|
}),
|
|
],
|
|
define: {
|
|
global: "globalThis",
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
});
|