3 ms·
By "wide use-cases" he means the Web and server. CJS doesn't work well on the web. ES6 modules were designed from the start to support both.
by Touche 12y ago
By "wide use-cases" he means the Web and server. CJS doesn't work well on the web. ES6 modules were designed from the start to support both.
- domenicd 12y agoThis is a common strawman, with several examples to disprove it: - https://github.com/cujojs/curl https://github.com/cujojs/curl - https://github.com/montagejs/mr https://github.com/montagejs/mr - https://github.com/substack/wreq https://github.com/substack/wreq
- Touche 12y agoto support CommonJS in the browser you either 1) require that it is wrapped (and therefore isn't really CommonJS) or 2) you XHR it, wrap it yourself, and eval. That's it's possible to work around the problem doesn't discount that it "doesn't work well" in browsers.