Skip to content

Commit

Permalink
"promisify" is not exported by "__vite-browser-external"
Browse files Browse the repository at this point in the history
vitejs/vite#7821
import { builtinModules } from 'module';

export default defineConfig({
  /* ... */
  build: {
    rollupOptions: {
      external: [...builtinModules, /^node:/]
    }
  }
}
  • Loading branch information
zjavax committed Mar 28, 2024
1 parent cfa0b40 commit 5a148c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -4,6 +4,8 @@ node_modules
.DS_Store
dist
dist-ssr
tool-plus
.env
*.local

# lock
Expand All @@ -13,4 +15,4 @@ pnpm-lock.yaml

*.log

.env

4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@cardano-ogmios/client": "^5.6.0",
"@cardano-ogmios/schema": "^5.6.0",
"@element-plus/icons-vue": "^2.3.1",
"@emurgo/cardano-serialization-lib-asmjs": "^11.5.0",
"axios": "^1.6.7",
"buffer": "^6.0.3",
Expand All @@ -31,10 +32,11 @@
"@types/node": "^20.6.0",
"@vitejs/plugin-vue": "^4.3.4",
"sass": "^1.66.1",
"terser": "^5.30.0",
"typescript": "^5.2.2",
"unocss": "^0.55.7",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.4.9",
"vite": "^2.6.14",
"vite-plugin-optimize-persist": "^0.1.2",
"vite-plugin-package-config": "^0.1.1",
"vite-plugin-wasm": "^3.3.0",
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Expand Up @@ -17,6 +17,7 @@ import {
transformerVariantGroup,
} from 'unocss'
import * as dotenv from 'dotenv'
import { builtinModules } from 'module'

// 打包体积分析 npm i rollup-plugin-visualizer -D
import { visualizer } from 'rollup-plugin-visualizer'
Expand Down Expand Up @@ -101,6 +102,8 @@ export default defineConfig({
rollupOptions: {
// // 打包时忽略某些包,避免打包时间过长
external: [
...builtinModules,
/^node:/,
'vue',
'vue-router',
'pinia',
Expand Down

0 comments on commit 5a148c6

Please sign in to comment.