Reputation: 972
I am confused about Webpack and gulp. I know gulp is task runner and webpack is module bundler, but it seems like there are many overlapping features? like compile, minification, temp live server etc. My question is can I replace gulp with webpack in production?
I know gulp has so many features, but I am mostly focusing minification, concatenation, live server, live reload, uglify, sourcemap.
Upvotes: 1
Views: 1346
Reputation: 372
You are right about the task runner vs. module bundler. The difference is that you tell Gulp how to put front-end code together step-by-step, but you tell Webpack what you want through a config file. So it's not just about the functionality overlap, but more of a mindset change.
Here is a short article (5 min read) I wrote explaining the differences with simple examples: https://medium.com/@Maokai/compile-the-front-end-from-gulp-to-webpack-c45671ad87fe
Our company moved from Gulp to Webpack in the past year. Although it took some time, we figured out how to move all we did in Gulp to Webpack. So to us, everything we did in Gulp can also be done through Webpack, but not the other way around.
Upvotes: 1
Reputation: 1561
If you only need the features that webpack provides then it's better to use webpack along with webpack dev server. Using both is redundant.
I'm currently using grunt and webpack in some of my projects that originally were grunt to concat, minify, and test. Now I spawn webpack and karma using grunt-concurrent.
Upvotes: 2