diff --git a/package.json b/package.json index 715bfb050fb0..fc1bde7e5c9b 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "axios": "^0.21.1", "babel-plugin-transform-node-env-inline": "^0.4.3", "browserslist": "^4.16.5", + "core-js": "^2.6.11", "jest": "^27.0.1", "lodash": "^4.17.21", "progress": "^2.0.3", diff --git a/spack/src/resolvers/mod.rs b/spack/src/resolvers/mod.rs index 440ba0e588ee..561652c0c3df 100644 --- a/spack/src/resolvers/mod.rs +++ b/spack/src/resolvers/mod.rs @@ -18,13 +18,73 @@ use std::{ use swc_bundler::Resolve; use swc_common::FileName; +// Run `node -p "require('module').builtinModules"` pub(crate) fn is_core_module(s: &str) -> bool { match s { - "assert" | "buffer" | "child_process" | "console" | "cluster" | "crypto" | "dgram" - | "dns" | "events" | "fs" | "http" | "http2" | "https" | "net" | "os" | "path" - | "perf_hooks" | "process" | "querystring" | "readline" | "repl" | "stream" - | "string_decoder" | "timers" | "tls" | "tty" | "url" | "util" | "v8" | "vm" | "wasi" - | "worker" | "zlib" => true, + "_http_agent" + | "_http_client" + | "_http_common" + | "_http_incoming" + | "_http_outgoing" + | "_http_server" + | "_stream_duplex" + | "_stream_passthrough" + | "_stream_readable" + | "_stream_transform" + | "_stream_wrap" + | "_stream_writable" + | "_tls_common" + | "_tls_wrap" + | "assert" + | "assert/strict" + | "async_hooks" + | "buffer" + | "child_process" + | "cluster" + | "console" + | "constants" + | "crypto" + | "dgram" + | "diagnostics_channel" + | "dns" + | "dns/promises" + | "domain" + | "events" + | "fs" + | "fs/promises" + | "http" + | "http2" + | "https" + | "inspector" + | "module" + | "net" + | "os" + | "path" + | "path/posix" + | "path/win32" + | "perf_hooks" + | "process" + | "punycode" + | "querystring" + | "readline" + | "repl" + | "stream" + | "stream/promises" + | "string_decoder" + | "sys" + | "timers" + | "timers/promises" + | "tls" + | "trace_events" + | "tty" + | "url" + | "util" + | "util/types" + | "v8" + | "vm" + | "wasi" + | "worker_threads" + | "zlib" => true, _ => false, } }