Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

javascript - How to use native client-side libraries in Meteor?

Current Meteor version:
Preview 0.6.6.3

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.

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.

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

My current application structure:

my_app/

  • css/
  • pages/
  • js/
  • .meteor/
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...