使用带有Requirejs的Meteor [英] Using Meteor with Requirejs

查看:75
本文介绍了使用带有Requirejs的Meteor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在流星应用程序中集成requirejs并使用AMD模块,例如我的Backbone模块?
有没有人这样做,可以告诉我需要哪些步骤让这个工作?

How can I integrate requirejs in a meteor app and use AMD–modules, e.g for my Backbone modules? Has anybody done that and can tell me what steps are needed to get this working?

推荐答案

一个简单的答案(虽然也许不是你想要的那个)但你可以简单地单独使用这两个。换句话说,加载所有的meteor脚本,然后开始加载require-ified脚本。你需要的脚本可以很好地使用Meteor的东西,而不必通过Require的加载器导入任何一个。

One simple answer (though maybe not the one you're looking for) is that you can simply use the two independently. In other words, load all of your meteor scripts, then start your require-ified scripts loading. Your require-ified scripts will be able to use the Meteor stuff just fine, without having to "import" any of it in via Require's loader.

如果你希望必须导入它,你应该为它创建一个Requireshim。

If you want to have to import it, you should instead create a Require "shim" for it.

这篇关于使用带有Requirejs的Meteor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆