How to remove jquery

I don't need jquery in my meteor application. When I type meteor remove jquery, the jquery: answer is not in the project. But jquery is still tied to html.

+4
source share
3 answers

The internal elements of Meteor (domutils) depend on jQuery, but I believe that the plan is to remove this dependency at a certain stage:

See: https://groups.google.com/forum/?fromgroups=#!topic/meteor-talk/21y9NbM9v90

Domutils seems to cope without jQuery if sizzle is present (see findAllBySelector). When performing a quick code scan, I did not see any other uses (except on the server side - less parser).

+1
source

To remove / replace jQuery with another version (2.x or 3.x). Clone the jquery package from official sources into the /packages project folder.

Replace the contents of jquery.js with anything.

A downloaded package will have a higher priority and will be used instead of the original one. Do it at your own peril and risk.

+1
source

This is how I remove jQuery from Meteor.

Before doing this, make sure your code is really jQuery independent. In addition, adding any Meteor packages depending on jQuery will no longer work as expected (for example: materialize: materialize).

So, if you want to make sure jQuery is removed from Meteor, no matter what, just put

 Package.describe({ summary: "Remove jQuery from meteor", name: "jquery", version: '1.999.999', }); 

in packages/jquery/package.js . No need to clone. No need to add any other files. Check your .meteor/versions file for writing:

 jquery@1.999.999 

to confirm that it worked.

+1
source

Source: https://habr.com/ru/post/1468955/


All Articles