Skip to content

Commit

Permalink
Better support for Deno target transform (#238)
Browse files Browse the repository at this point in the history
* feat: better support for Deno target transform

* Reduce bloats on output for deno
  • Loading branch information
cometkim committed Dec 4, 2023
1 parent fb11c28 commit 24d37be
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-glasses-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nanobundle": minor
---

Better support for Deno target transform
5 changes: 5 additions & 0 deletions .changeset/tame-bees-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nanobundle": minor
---

Reduce bloats on output for deno
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"bin.mjs"
],
"engines": {
"node": ">=18.0.0"
"node": ">=18.0.0",
"deno": ">=1.9.0"
},
"resolutions": {
"vite": "^5.0.0"
Expand Down
3 changes: 0 additions & 3 deletions src/target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const browsersToTargets = {
'android': 'chrome',
'and_chr': 'chrome',
'and_ff': 'firefox',

// FIXME: better compat mode
'deno': 'chrome',
} as const;

const supportedBrowsers = new Set(Object.keys(browsersToTargets));
Expand Down
1 change: 1 addition & 0 deletions src/tasks/buildBundleTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ async function buildBundleGroup({
};

if (options.platform === 'deno') {
esbuildOptions.target = ['deno1.9'];
esbuildOptions.platform = 'neutral';
} else {
esbuildOptions.platform = options.platform;
Expand Down

0 comments on commit 24d37be

Please sign in to comment.