Comments (5)
Gulp and Webpack have different responsibilities
- Gulp is a task automation framework
- Webpack is a build system, which happens to be set up here as a Gulp task
Not unusual to use both, although I'm see more and more projects skip Gulp and just use npm scripts instead
- https://docs.npmjs.com/misc/scripts
- http://blog.npmjs.org/post/127671403050/testing-and-deploying-with-ordered-npm-run-scripts
from starter-kit.
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?
from starter-kit.
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
from starter-kit.
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 :)
from starter-kit.
@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.
from starter-kit.
Related Issues (12)
- Cannot clone HOT 1
- no need for gulp to be installed globally HOT 1
- npm start failing HOT 3
- Clearer documentation for gulpfile.babel.js
- A question HOT 1
- SyntaxError: Unexpected token import HOT 1
- testing with ava and zombie HOT 3
- switch to CSS-modules via webpack HOT 4
- gulp serve fails
- Some rookie questions
- batchedSubscribe brokes async dispatches
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starter-kit.