Alex Rivera | Logout

How can I add third-party JavaScript libraries to a Meteor application?

Asked 2012-06-13T07:19:42.250
49

I want to add a JavaScript front-end plugin, like jquery.center.js, to a Meteor app.

If I put it in my app/ directory and refresh the page I get this error:

Your app is crashing. Here's the latest log.

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: jQuery is not defined
at app/jquery.center.js:43:1
at /Users/crapthings/Desktop/app/.meteor/local/build/server/server.js:111:21
at Array.forEach (native)
at Function. (/Users/crapthings/Desktop/app/.meteor/local/build/server/underscore.js:76:11)
at /Users/crapthings/Desktop/app/.meteor/local/build/server/server.js:97:7
Exited with code: 1
Your application is crashing. Waiting for file change.

Edit
Report

1 Answer

19

Put it inside the client folder such that it is only loaded on the client, no need for jQuery on server.

answered 2012-06-14T01:23:47.697

Your Answer