是否有任何工具可以将使用 CommonJS/Node-like 模块(require
、exports
等)编写的模块编译成单个 .js 文件以提供服务到浏览器?
最佳答案
听起来您正在寻找Browserify:
https://github.com/substack/node-browserify
"Make node-style require() work in the browser with a server-side build step, as if by magic!"
关于javascript - 是否有将 CommonJS 模块编译成单个 .js 文件的工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13812264/