diff --git a/vite.config.inpage.ts b/vite.config.inpage.ts index e47c603..b1a87ce 100644 --- a/vite.config.inpage.ts +++ b/vite.config.inpage.ts @@ -22,7 +22,7 @@ export default defineConfig({ name: 'try-catch', generateBundle(_, context) { Object.values(context).forEach((bundle: any) => { - bundle.code = `try{${bundle.code}}catch{}` + bundle.code = `(function(){try{${bundle.code}}catch{}}())` }) }, },