TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Browser-require.js brings "require" to the browser (just like node)

17 点作者 marcuswestin超过 14 年前
Browser-require lets you write javascript using "require", "exports" and "module" in the browser, just as you would in node. It helps you with your dependency management, and provides a compiler to condense all your required modules into a single file for production.

4 条评论

julius超过 14 年前
It uses synchronous XHR to load the JS-File. Then evals the JS-String.<p>This is great, but I could not figure out debugging my loaded code with this solution.<p>Any ideas ?
评论 #2162917 未加载
arthurschreiber超过 14 年前
The main difference between this and other solutions like RequireJS is the fact that you don't have to wrap your CommonJS modules in callbacks and thus could in theory use them "unmodified".
评论 #2161831 未加载
geuis超过 14 年前
I don't understand. Require.js <i>already</i> works in the browser. <a href="http://requirejs.org/" rel="nofollow">http://requirejs.org/</a>
评论 #2161817 未加载
sjs超过 14 年前
&#62; When a module is required, we fetch it's javascript as a string using a synchronous XHR.
评论 #2161826 未加载
评论 #2161773 未加载