Skip to content

Commit 988ff3f

Browse files
committed
fix #1294: update the list of native node modules
1 parent 4cc1001 commit 988ff3f

File tree

2 files changed

+62
-40
lines changed

2 files changed

+62
-40
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
* Update the list of built-in node modules ([#1294](https://github.com/evanw/esbuild/issues/1294))
6+
7+
The list of built-in modules that come with node was outdated, so it has been updated. It now includes new modules such as `wasi` and `_http_common`. Modules in this list are automatically marked as external when esbuild's platform is configured to `node`.
8+
39
## 0.12.0
410

511
**This release contains backwards-incompatible changes.** Since esbuild is before version 1.0.0, these changes have been released as a new minor version to reflect this (as [recommended by npm](https://docs.npmjs.com/cli/v6/using-npm/semver/)). You should either be pinning the exact version of `esbuild` in your `package.json` file or be using a version range syntax that only accepts patch upgrades such as `~0.11.0`. See the documentation about [semver](https://docs.npmjs.com/cli/v6/using-npm/semver/) for more information.

internal/resolver/resolver.go

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,44 +1681,60 @@ func IsPackagePath(path string) bool {
16811681
}
16821682

16831683
var BuiltInNodeModules = map[string]bool{
1684-
"assert": true,
1685-
"async_hooks": true,
1686-
"buffer": true,
1687-
"child_process": true,
1688-
"cluster": true,
1689-
"console": true,
1690-
"constants": true,
1691-
"crypto": true,
1692-
"dgram": true,
1693-
"dns": true,
1694-
"domain": true,
1695-
"events": true,
1696-
"fs": true,
1697-
"http": true,
1698-
"http2": true,
1699-
"https": true,
1700-
"inspector": true,
1701-
"module": true,
1702-
"net": true,
1703-
"os": true,
1704-
"path": true,
1705-
"perf_hooks": true,
1706-
"process": true,
1707-
"punycode": true,
1708-
"querystring": true,
1709-
"readline": true,
1710-
"repl": true,
1711-
"stream": true,
1712-
"string_decoder": true,
1713-
"sys": true,
1714-
"timers": true,
1715-
"tls": true,
1716-
"trace_events": true,
1717-
"tty": true,
1718-
"url": true,
1719-
"util": true,
1720-
"v8": true,
1721-
"vm": true,
1722-
"worker_threads": true,
1723-
"zlib": true,
1684+
"_http_agent": true,
1685+
"_http_client": true,
1686+
"_http_common": true,
1687+
"_http_incoming": true,
1688+
"_http_outgoing": true,
1689+
"_http_server": true,
1690+
"_stream_duplex": true,
1691+
"_stream_passthrough": true,
1692+
"_stream_readable": true,
1693+
"_stream_transform": true,
1694+
"_stream_wrap": true,
1695+
"_stream_writable": true,
1696+
"_tls_common": true,
1697+
"_tls_wrap": true,
1698+
"assert": true,
1699+
"async_hooks": true,
1700+
"buffer": true,
1701+
"child_process": true,
1702+
"cluster": true,
1703+
"console": true,
1704+
"constants": true,
1705+
"crypto": true,
1706+
"dgram": true,
1707+
"diagnostics_channel": true,
1708+
"dns": true,
1709+
"domain": true,
1710+
"events": true,
1711+
"fs": true,
1712+
"http": true,
1713+
"http2": true,
1714+
"https": true,
1715+
"inspector": true,
1716+
"module": true,
1717+
"net": true,
1718+
"os": true,
1719+
"path": true,
1720+
"perf_hooks": true,
1721+
"process": true,
1722+
"punycode": true,
1723+
"querystring": true,
1724+
"readline": true,
1725+
"repl": true,
1726+
"stream": true,
1727+
"string_decoder": true,
1728+
"sys": true,
1729+
"timers": true,
1730+
"tls": true,
1731+
"trace_events": true,
1732+
"tty": true,
1733+
"url": true,
1734+
"util": true,
1735+
"v8": true,
1736+
"vm": true,
1737+
"wasi": true,
1738+
"worker_threads": true,
1739+
"zlib": true,
17241740
}

0 commit comments

Comments
 (0)