Is it possible to transpile jQuery to Vanilla JS?

北城余情 提交于 2020-12-05 11:53:25

问题


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 :)


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/38074387/is-it-possible-to-transpile-jquery-to-vanilla-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!