diff --git a/nuxt.config.js b/nuxt.config.js index f36448b..a64445a 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -91,7 +91,15 @@ export default defineNuxtConfig({ ], }, }, + nitro: { + externals: { + inline: ['tslib'] // 将 tslib 内联到构建中 + } + }, + build: { + transpile: ['tslib'] // 确保 tslib 被正确转译 + }, vite: { build: { target: 'esnext', diff --git a/package.json b/package.json index 24f31fb..9634947 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "segmentit": "^2.0.3", "vconsole": "^3.15.1", "vue": "^3.5.13", - "vue-router": "^4.5.0" + "vue-router": "^4.5.0", + "tslib": "^2.6.0" }, "devDependencies": { "@iconify-json/carbon": "^1.2.5",