如何在 Meteor 中使用本地客户端库? [英] How to use native client-side libraries in Meteor?

查看:19
本文介绍了如何在 Meteor 中使用本地客户端库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前的流星版本:
预览 0.6.6.3

Current Meteor version:
Preview 0.6.6.3

我想在我的 Meteor 项目(在 Ubuntu 和 Windows 上)中添加带有 Meteor 或陨石的客户端库,例如 Taggle.js.
这些库在 Atmosphere 上不能作为包提供.

I am tying to add client libraries in my Meteor project (on Ubuntu and also on Windows) with Meteor or meteorite, such as Taggle.js.
Those libraries are not available as packages on Atmosphere.

我试图将我的 *.js 复制并粘贴到 .meteor/local/build/programs/client.meteor/local/build/程序/客户端/应用程序 但它不起作用.

I tried to copy and paste my *.js in the .meteor/local/build/programs/client or .meteor/local/build/programs/client/app but it didn't work.

如何将客户端本机库放入我的 Meteor 项目中?

How can I put client-side native libraries in my Meteor project?

我目前的应用结构:

my_app/

  • css/
  • pages/
  • js/
  • .meteor/

推荐答案

你不应该手动弄乱 .meteor 目录中的文件(除了 packages>release 文件),这是 Meteor 放置其编译文件的地方.所有库都应该转到源文件夹 - 所以基本上是其他任何地方.

You shouldn't manually mess with files in .meteor directory (except for packages and release files), that's where Meteor puts its compiled files. All libraries should go to source folder - so basically anywhere else.

我假设这些是客户端库.

I assume those are client-side libraries.

在那种情况下,把它们:

In that case, put them:

  • /client 中,如果它们何时加载并不重要并且它们碰巧在那里工作;
  • /client/lib 中,如果您需要在其余代码之前加载它们;
  • /client/compatibility 中,如果代码未准备好与 Meteor 一起使用,并且您不想/不知道如何修复它;
  • /client/lib/compatibility 中,如果上述两种情况都发生.为了安全起见,我建议一开始就把它们放在这里.
  • in /client if it doesn't matter when they are loaded and they happen to work there;
  • in /client/lib if you need to load them before the rest of the code;
  • in /client/compatibility if the code is not prepared to work with Meteor and you don't want to / don't know how to fix it;
  • in /client/lib/compatibility if both of the above conditions occur. I'd recommend to put them here on the beginning just to be safe.

这篇关于如何在 Meteor 中使用本地客户端库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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