I’m looking to upgrade the 1.11 version included by default with meteor to the NPM package which is in the version 3+. I’ve seen a couple of post on how to do this but they are quite old and at the end someone establishes the method is no longer working and that meteor is loading both the old and the new JQuery. Is there anyone that could point me in the right direction?
jqueryis no longer in the default package list after running
meteor create, however is still available thanks to
blaze-html-templates. If you still require jQuery, the recommended approach is to install it from npm with
meteor npm install --save jqueryand then
import-ing it into your application. #8388
If you have
jquery in your
.meteor/packages file, first remove it (
meteor remove jquery or just delete the line in the file), then follow the above guidance.
Relevant issue: https://github.com/meteor/meteor/issues/10289
We ended up forking the
jquery package and modifying it very much in the spirit of this PR: https://github.com/meteor/meteor/pull/10498/files
If you don’t use animations and care for your bundle size, you may consider this as a very thin replacement of jQuery: https://www.npmjs.com/package/cash-dom . It uses the same syntax. I have it in production and nothing to complain about.
…also, if you don’t have to support some ancient legacy browsers