3 ms·
have you used gulp? It allows you to code up a processing pipeline in a pretty intuitive way. Webpack, even though its config is written in JS, is basically mag
by beaconstudios 9y ago
have you used gulp? It allows you to code up a processing pipeline in a pretty intuitive way. Webpack, even though its config is written in JS, is basically magic JSON files. Gulp offers near-total control over the build process which also helps with optimising things like build speed.
- chatmasta 9y agoPerhaps there is a reason webpack has surpassed gulp in terms of popularity. Build systems have historically favored declarative configuration over programmability. See Makefiles for an example. I’m not saying that’s necessarily the right approach, but it does seem like declarative configuration is a natural way to define a build system. That said, I wholeheartedly agree there is much room for improvement with webpack.
- beaconstudios 9y agoI'd argue that Makefiles are a good argument in favour of programmability, compared to something like Maven which is configurable. Gulp doesn't really play in the same league as webpack as it's not really got the ecosystem, nor is it optimised for, web builds. Declarative config definitely seems to be winning out in terms of popularity but the more configurable you need your build to be, the more the config ends up replicating a programming language anyway - or you end up being locked into restrictive rulesets and patterns, like webpack does.
- alayek 9y agoThis is an apple to orange comparison. Gulp is a tool that lets you decide what the build process should look like. Webpack is a tool where you define entry points, split points etc., and what you finally need. Based on that webpack decides how to go about the build. Most of what Gulp does, can be replaced with NPM scripts.
- beaconstudios 9y agoit's the streaming/caching side of gulp that I find most useful to be honest. When I have 3-4 build outputs being generated and I can offload intermediate objects into a cache file and back it can lead to really fast builds. In replacing grunt with gulp and setting up gulp correctly I've reduced builds from 10-15 seconds to nearly instant before, and I think the main failing of webpack is how slow a non-watch build can run, or how large its output size can be. I think entrypoints and code splitting could be achieved with a gulp-like system by picking files to be packaged into different builds. It's also very easy to find build bottlenecks with gulp which is very handy if you have a large project with a slow build. It allows you to scale out efficiently.
- chatmasta 9y agoWebpack hot reload server solves this problem and provides nearly instant builds. Yes, production (“non-watch”) builds can take a while. But who cares? You shouldn’t be running a production build after every code change. That’s why the hot reload server is so useful; it only recompiles the code you changed.
- qaq 9y agowebpack has fairly simple plugin interface you can write a plugin that will hook into anything you want you are basically implementing a single function apply(compiler).
- dandelany 9y agoIt sounds like what you want exists: it's gulp! If it's useful and makes sense to you, there's no reason to stop using it just because webpack is the hip new thing :)