How to resolve Node.js core modules #1393
Unanswered
codegenic-works
asked this question in
Q&A
Replies: 2 comments 2 replies
-
web dev server is executing test in an actual browser... and a browser does not have Are you maybe looking for a node testing tool like mocha or uvu? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Add this to your config: import nodePolyfills from 'rollup-plugin-node-polyfills';
import {fromRollup} from '@web/dev-server-rollup';
export default {
plugins: [
fromRollup(nodePolyfills)(),
],
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I recently installed a npm package that makes use of some of the Node.js core modules like
fs
,os
, andcrypto
. When trying to run the web server I get errors stating that those imports cannot be resolved. I was looking through the documents and I might be missing it, but, is there a setting or plugin that I need to use to polyfill those?Just to cover the basis, here is my command line:
wds --app-index index.html --open --watch --node-resolve
And my web-dev-server.config.js is:
Much thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions