Giter VIP home page Giter VIP logo

Comments (5)

jokeyrhyme avatar jokeyrhyme commented on August 27, 2024

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

from starter-kit.

myndzi avatar myndzi commented on August 27, 2024

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.

jokeyrhyme avatar jokeyrhyme commented on August 27, 2024

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.

myndzi avatar myndzi commented on August 27, 2024

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.

jamesknelson avatar jamesknelson commented on August 27, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.