A
A
askold20132017-11-25 14:53:33
gulp.js
askold2013, 2017-11-25 14:53:33

Are there similar plugins for webpack or gulp?

Hello!
Surely everyone has encountered such a problem - we write in jquery and use at most 3-5 functions from more than 10k lines of jquery. That is, most of the 84kb minified file just lie like a corpse and never work. The problem is exacerbated when we include another bunch of plugins, which also have a lot of code idle. And if you also connect vue ...
It would be nice to run all these dependent libraries and frameworks through a plugin that will take our custom js as an argument, in which these dependencies are used. The plugin will parse it, find functions, variables, etc. that are not declared in it, and start looking for them in dependent libraries. And it will pull out only the working code from them, collecting it into one file.
I want to ask if there is such a solution for optimizing the final weight of javascript sources. And what other solutions are there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Bobylev, 2017-11-25
@dpigo

It's easier not to use jQuery or use its custom build, throwing out unused modules.

F
frammmm, 2017-11-25
@frammmm

Exist. It's called tree shaking .
You can also look at rollup

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question