28 lines
762 B
JavaScript
28 lines
762 B
JavaScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
|
|
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
plugins: [
|
|
NodeGlobalsPolyfillPlugin({
|
|
buffer: true
|
|
}),
|
|
NodeModulesPolyfillPlugin()
|
|
]
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
stream: 'stream-browserify',
|
|
util: 'util',
|
|
assert: 'assert',
|
|
}
|
|
},
|
|
})
|