Stop using Webpack building projects
Webpack is an amazing tool, for bundling, not for building.
However, I have to say that some building steps seem quite weird within.
- Analogously, somebody uses plugins to copy files, or something else has nothing to do with “bundling”.
You cannot predict how complicated your project will transform to be. If you already have used Webpack to do all the works of your project building, in a way your project is kind of a little simple. Someday, the requirements may be changed, then you have to update your building process, that may be deadly fatal if your building architecture is not flexible enough.
- Images minify;
- Less/css compile, link images, minify;
- Others just copy
Building a project is a complex work, you may solve it with Webpack, but that’s not the best way. Webpack has many limitations, and won’t be suitable to all requirements.
Of course, if you’re building a library, Webpack would be a good choice.
The best practice is treating Webpack as a plugin of a real building tool like Grunt or Gulp. They are both good at processing multiple kinds of files. I suggest Gulp because it’s faster and controls building flow much easier.
Using Webpack with Gulp is quite easy: gulp-webpack is Gulp plugin.
Remember, only use Webpack to bundle, use Gulp or any other tool you love to build, because this is important and sustainable:
Each performs its own functions.
So, what do you think?