Problems with browserify
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 13.7k
- 派生
- 1.1k
- PR 合并指标
- 30 天内没有已合并 PR
描述
This kind of environment selectors destroy browserify (code is shortened for brevity).
if (ENVIRONMENT_IS_NODE) {
var nodeFS = require('fs');
var nodePath = require('path');
Browserify resolves the require even if it's inside of the if. Because of this, a big piece of Node.js is Browserified and never used because the code never falls there.
This is a nonsense. Is there any simple workaround to solve this problem inside the library?
It's easy to separate the environment selection in two files, one with the browser part and another with the node part but that's not cool for packaging.
What do you think?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Start by reproducing the Browserify build around the ENVIRONMENT_IS_NODE block and inspect how the require('fs') and require('path') calls are resolved. Define a packaging-compatible way to avoid bundling unused Node.js code, then verify that the browser build succeeds without that code.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- build-system, web-dev
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100