You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #989, but now occurring only when Microbundle's target is not Node.js. I'm compiling a library that runs in both Node.js and a browser, and the library contains dynamic imports for node built-ins like 'fs', executed only in Node.js.
When importing fs I can add the following to my package.json and everything works fine:
"browser": {
"fs": false,
"path": false
},
However, using node:fs, the same thing does not work, and warnings appear with:
@machao7 You can subscribe to the issue and get notified whenever there's progress. When there is, you'd see it here.
Honestly I'd recommend avoiding the browser field spec anyhow, package.json#exports has completely eclipsed it. Output separate browser & Node bundles, don't rely upon bundlers patching out your imports. It's always been a pretty bad hack for isomorphic modules.
Similar to #989, but now occurring only when Microbundle's target is not Node.js. I'm compiling a library that runs in both Node.js and a browser, and the library contains dynamic imports for node built-ins like 'fs', executed only in Node.js.
When importing
fs
I can add the following to mypackage.json
and everything works fine:However, using
node:fs
, the same thing does not work, and warnings appear with:Microbundle v0.15.1, Node.js v18.12.1.
The text was updated successfully, but these errors were encountered: