xtraderClient/vite.config.ts
2026-02-06 12:31:58 +08:00

36 lines
974 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// import { fileURLToPath, URL } from 'node:url'
// import { defineConfig } from 'vite'
// import vue from '@vitejs/plugin-vue'
// import vueJsx from '@vitejs/plugin-vue-jsx'
// import vueDevTools from 'vite-plugin-vue-devtools'
// // https://vite.dev/config/
// export default defineConfig({
// plugins: [vue(), vueJsx(), vueDevTools()],
// resolve: {
// alias: {
// '@': fileURLToPath(new URL('./src', import.meta.url)),
// },
// },
// })
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// 1. 导入插件
import { nodePolyfills } from 'vite-plugin-node-polyfills'
export default defineConfig({
plugins: [
vue(),
// 2. 将此插件添加到插件数组中
nodePolyfills({
// 为了彻底解决SIWE等库的问题建议包含以下选项
protocolImports: true,
}),
],
// 3. 可选但推荐:显式定义 process.env 以避免其他潜在错误
define: {
'process.env': {},
},
})