Webpack problem with `node:` modules
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 8.1k
- Forks
- 846
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to build browser code, which uses ejs.
import ejs from "ejs";
...
Webpack throws error - "node: urls are not supported".
Ejs contains imports for "node:fs" and "node:path".
Is it possible to add browser exports to the package.json which will point to the ejs module with fs functionality removed?
Generally is should be two modules.
First - for browser, without fs.
Second - for node - if should extends browsed version with fs methods.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting package.json and the ejs imports of node:fs and node:path. Check how Webpack resolves the package for browser code and how the Node entry currently exposes fs functionality. Done means browser consumers can build without the node: URL error while Node consumers retain the existing fs-related behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100