Skip to content

Commit

Permalink
fix #626: "import.meta" is supported in node 10.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 29, 2020
1 parent 150a018 commit ef61169
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

* Mark `import.meta` as supported in node 10.4+ ([#626](https://github.com/evanw/esbuild/issues/626))

It was previously marked as unsupported due to a typo in esbuild's compatibility table, which meant esbuild generated a shim for `import.meta` even when it's not necessary. It should now be marked as supported in node 10.4 and above so the shim will no longer be included when using a sufficiently new target environment such as `--target=node10.4`.

## 0.8.26

* Ensure the current working directory remains unique per `startService()` call
Expand Down
1 change: 1 addition & 0 deletions internal/compat/js_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ var jsTable = map[JSFeature]map[Engine][]int{
ES: {2020},
Firefox: {62},
IOS: {12},
Node: {10, 4},
Safari: {11, 1},
},
Let: {
Expand Down
2 changes: 1 addition & 1 deletion scripts/compat-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ mergeVersions('ImportMeta', {
es2020: true,
firefox62: true,
ios12: true,
node10_4: false, // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta
node10_4: true, // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta
safari11_1: true,
})

Expand Down

0 comments on commit ef61169

Please sign in to comment.