Skip to content

Commit

Permalink
Support vite instead of parcel
Browse files Browse the repository at this point in the history
  • Loading branch information
decs committed Mar 1, 2024
1 parent 6750648 commit 6020881
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/bundlers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6020881

Please sign in to comment.