diff --git a/examples/bundlers/package.json b/examples/bundlers/package.json index 2b81feb..0ae4b79 100644 --- a/examples/bundlers/package.json +++ b/examples/bundlers/package.json @@ -4,10 +4,10 @@ "private": true, "type": "module", "scripts": { - "test": "pnpm test:bun && pnpm test:esbuild && pnpm test:parcel && pnpm test:rollup && pnpm test:swc && pnpm test:vite && pnpm test:webpack", + "test": "pnpm test:bun && pnpm test:esbuild && pnpm test:rollup && pnpm test:swc && pnpm test:vite && pnpm test:webpack", "test:bun": "bun build src/main.ts --outdir=bun_dist && node bun_dist/main.js", "test:esbuild": "esbuild src/main.ts --bundle --outdir=esbuild_dist && node esbuild_dist/main.js", - "test:parcel": "parcel build src/main.ts --dist-dir=parcel_dist --no-cache && node parcel_dist/main.js", + "//test:parcel": "parcel build src/main.ts --dist-dir=parcel_dist --no-cache && node parcel_dist/main.js", "test:rollup": "rollup --config && node rollup_dist/main.js", "test:swc": "swc src/main.ts --out-dir=swc_dist && node swc_dist/src/main.js", "test:vite": "vite build --outDir=vite_dist", diff --git a/tsup.config.ts b/tsup.config.ts index 3f2149b..757dea2 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -11,8 +11,7 @@ const dynamicImportsPlugin: Plugin = { contents: fs.readFileSync(args.path, 'utf-8').replace( /([ \t]*)const (\w+|{.+}) = await import\((.*)\);\s*return ([^;]+);/g, `$1try { -$1 const moduleName = $3; -$1 const $2 = await import(/* webpackIgnore: true */ moduleName); +$1 const $2 = await import(/* webpackIgnore: true */ $3); $1 return $4; $1} catch (error) { $1 throw error;