4 ms·
Webpack (or any other build tool, really) is complex because people's needs are complex. You don't really need to spend too much time configuring Webpack if yo
by GeneralMaximus 9y ago
Webpack (or any other build tool, really) is complex because people's needs are complex.
You don't really need to spend too much time configuring Webpack if you're just trying to bundle a bunch of JS files together. I.e, if you don't need the fancy loaders and plugins and just want an optimized JS bundle, the instructions on this page are all you need: https://webpack.js.org/api/cli/ https://webpack.js.org/api/cli/ (see section titled "Usage Without Config File")
But of course, you don't want just that. You want support for ES6, JSX, bundling and optimizing CSS, autoprefixing, bundle splitting, building SVG sprite sheets, etc. etc. At that point you just have to deal with the complexity.
> Personally, I've found the commitment to stick to the conventions enforced by Create React App to have been largely beneficial (at least so far (in one project)). And I've been surprised how willing and able I am to creatively work within those limitations.
I feel the same way. I no longer configure my build system from scratch. I try to work with create-react-app's defaults for as long as possible, and eject if I can't coax it into doing something I need. It's no different from letting XCode or Visual Studio autogenerate a project for you and customizing it as you go along.
At the end of the day, I'd rather write code than configure build systems. But sadly, they're a necessary evil no matter what tech stack you work with. I personally feel that it's not worth spending time learning them deeply, but I'm prepared to pull up that Webpack manual one day because I know I'm definitely going to need it at some point.