Is it possible to transpile jQuery to Vanilla JS?

6k views Asked by At

I use traceur / babel to transpile ES6 to ES5 but is it possible to use an gulp plugin to transpile jQuery to plain javascript? Thanks for Your answers :)

3

There are 3 answers

0
Marcel Ennix On BEST ANSWER

You can open the jquery.js and look for the relevant functions you want to convert to native javascript.

Copy it into a new helper.js, include it instead of jquery.js (or jquery.min.js) and use this functions. Voila, native js-functions.

1
spoq On

There is no gulp plugin to transpile jQuery to javascript. This is somewhat related to this question Is there an easy way to convert jquery code to javascript? . What you would need to do is to find out what you are doing with jQuery and look up ways of doing it with vanilla javascript instead and then you would not need jQuery.

0
Edmon Belchev On

Actually you can google for a tool to convert it. There are a lot. Here is one for example: https://www.workversatile.com/jquery-to-javascript-converter

Just copy -> paste your jQuery code and convert it.

Just be careful and try to convert the code step by step, because there might be some bugs and errors.