-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why Gulp? #12
Comments
Gulp and Webpack have different responsibilities
Not unusual to use both, although I'm see more and more projects skip Gulp and just use npm scripts instead |
Thanks for the response. I do understand the distinction; perhaps I should clarify my question: what is gulp doing that webpack (and/or possibly some npm scripts) can't, or is bad at? |
Of everything mentioned so far, npm scripts are the only alternative to gulp. webpack is not a task framework. Gulp is theoretically more efficient than npm scripts, in that it can pass file contents through multiple pipelines, avoiding unnecessary disk writes in between. I also like that gulp tasks can describe their dependencies, and gulp will execute them in the best order. Also, gulp and grunt tend to have fewer cross-platform issues than pure npm scripts. That said, many of my projects just use npm scripts, because it's so easy to get started. /shrug |
Well your gulpfile is pretty straightforward, to the point it almost seemed unnecessary, and it was doing some of webpack's job in terms of manipulating the content and output of files; that's what prompted the question. (I don't know Webpack well enough, but it seems that the CSS portion is a bit hasslesome when building a distribution.) The question was less from a perspective of "why are you doing this unnecessary thing", and more from a perspective of "what necessitated doing it this way". Anyway, no need to keep an issue open, I was just asking for some insight into the design choices here and I thought it might be worth having a documented answer for other people to run into, too :) |
@myndzi Good question. Back when I wrote my build scripts, webpack's plugin for generating index.html was either unknown or non-existent (not sure which one). Thus the gulp script. I could convert things to use that plugin, but I honestly don't think this should be the responsibility of Webpack. Webpack is a module bundler, not a HTML file generator. And as @jokeyrhyme mentioned, gulp is useful for running tasks anyway, so I've left it in there. |
This project looks interesting, but I'm confused as to why both Webpack and Gulp are in use. Why not use Webpack to produce distribution builds?
The text was updated successfully, but these errors were encountered: