developit / developit/microbundle
Failed to resolve the module node:* when target ≠ "node"
- Ngôn ngữ chính
- JavaScript
- Star
- 8.1k
- Fork
- 358
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Similar to https://github.com/developit/microbundle/issues/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:
```
"browser": {
"node:fs": false,
"node:path": false
},
```
```
Failed to resolve the module node:fs
```
Microbundle v0.15.1, Node.js v18.12.1.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.