V
V
Vyacheslav Lebedev2015-12-16 23:50:36
gulp.js
Vyacheslav Lebedev, 2015-12-16 23:50:36

Gulp plugin to remove unused javascript functions?

Good day!
I'm looking for a plugin of similar functionality (gulp-uncss), only for javascript.
Tell me if there is one?
Is it possible to write it and what pitfalls/difficulties might arise?
If it hasn't been written yet, why not, it would be great to reduce the production footprint, especially for those who love jQuery and cram it in for the sake of $() brevity.
For example - underscore, offhand, is it possible to remove unused functions from such libs without compromising the functioning of only the necessary functions?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Lebedev, 2017-02-04
@slavikse

Tree-shaking with webpack 2

S
sim3x, 2015-12-17
@sim3x

No
There is https://developers.google.com/closure/compiler/doc... but it's the best that clever renaming of functions can offer (if you write code in a special way)
JS is a dynamic language, which greatly complicates this kind of optimization

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question