From 6018e586b91125233026ca977a97b72bb6082ec6 Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Wed, 4 May 2022 18:40:41 -0500 Subject: [PATCH] chore: Silence warnings when using 'node:' protocol (#956) * chore: Silence warnings when using builtins w/ 'node:' protocol * docs: Adding changeset --- .changeset/hot-dryers-train.md | 5 +++++ src/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/hot-dryers-train.md diff --git a/.changeset/hot-dryers-train.md b/.changeset/hot-dryers-train.md new file mode 100644 index 00000000..d12b08cd --- /dev/null +++ b/.changeset/hot-dryers-train.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Silences warnings when using Node builtins with the 'node:...' protocol on imports. Warnings related to bare usage of these builtins were already silenced. diff --git a/src/index.js b/src/index.js index de04f040..950d0897 100644 --- a/src/index.js +++ b/src/index.js @@ -347,7 +347,7 @@ function createConfig(options, entry, format, writeMeta) { // We want to silence rollup warnings for node builtins as we rollup-node-resolve threats them as externals anyway // @see https://github.com/rollup/plugins/tree/master/packages/node-resolve/#resolving-built-ins-like-fs if (options.target === 'node') { - external = external.concat(builtinModules); + external = [/node:.*/].concat(builtinModules); } const peerDeps = Object.keys(pkg.peerDependencies || {});