文件名称:browserify:浏览器端require()的node.js方法-开源
文件大小:333KB
文件格式:ZIP
更新时间:2024-06-04 04:30:12
开源软件
Browserify通过捆绑所有依赖项,使您在浏览器中需要(模块)。 浏览器没有定义require方法,但是Node.js有。 使用Browserify,您可以编写使用require的代码,就像在Node中使用它一样。 使用npm安装uniq模块。 现在,使用browserify命令将从main.js开始的所有必需模块递归地捆绑到一个名为bundle.js的文件中。 Browserify分析AST的require()调用,以遍历项目的整个依赖关系图。 丢单 tag into your html and you're done! browserify is a tool for compiling node-flavored commonjs modules for the browser. You can use browserify to organize your code and use third-party libraries even if you don't use node itself in any other capacity except for bundling