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

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

问题描述

Current 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.

我试图在<$ c中复制并粘贴我的 *。js $ c> .meteor / local / build / programs / client 或 .meteor / local / build / programs / client / app 但它没有'工作。

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 current application structure:


my_app /


  • css /

  • pages /

  • js /

  • .meteor /

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


推荐答案

你不应该手动搞乱机智h文件在 .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天全站免登陆