Skip to content

Commit

Permalink
chore: Silence warnings when using 'node:' protocol (#956)
Browse files Browse the repository at this point in the history
* chore: Silence warnings when using builtins w/ 'node:' protocol

* docs: Adding changeset
  • Loading branch information
rschristian committed May 4, 2022
1 parent d16a322 commit 6018e58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-dryers-train.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {});
Expand Down

0 comments on commit 6018e58

Please sign in to comment.