dvdzkwsk / react-redux-starter-kit

Get started with React, Redux, and React-Router.
MIT License
10.29k stars 2.2k forks source link

Request: simplify the webpack/build config #1056

Open glifchits opened 7 years ago

glifchits commented 7 years ago

Firstly, thanks for this awesome starter kit. I've found it really useful while starting a new project!

However, I have one major gripe which will prevent me from using this starter kit in the future, and it's that the configuration is extremely convoluted and over-engineered.

For the most part, you should be able to make changes in [~/config/index.js] without ever having to touch the actual webpack build configuration.

In my opinion, a well-documented webpack.config.js file for each environment is much more useful than config that is created with several layers of logic and abstraction. Lots of code inside the bin, build, config, and server folders are all affected by config settings, and it is really tough to ultimately understand what's going on.

I chose this starter kit since it includes the essential components of a React app (babel, redux, react-router) plus a good test setup, and not much else, which is why it's the best React starter kit in my opinion. By simplifying the config, I think you have a great opportunity to be the alternative to create-react-app for people who want a minimal but complete starter kit that they can configure out of the box.

dvdzkwsk commented 7 years ago

You raise some good points, I will consider making some changes to simplify it. The idea for config was that it was meant to abstract away all of the annoying aspects of webpack and provide a clean interface for changing project settings, but it does increase cognitive overhead. I dislike having to import various tool-specific configs around the project to get the values you need (i.e. importing the webpack config into the server to use the correct port), so that's also part of the rationale for why things are the way they are now. This, however, may achievable more simply than how it is currently.

Let me think on it a bit this weekend, and hopefully if some time opens up I can open up a PR to simplify things.

dvdzkwsk commented 7 years ago

Been slammed (as usual); this is still on my radar but unfortunately I have not had much time to work on this project.

Related: https://github.com/davezuko/react-redux-starter-kit/issues/1004

glifchits commented 7 years ago

No worries @davezuko! Thanks for keeping your attention to this, I really think a simpler config would take this starter kit to a new level of awesomeness.

One opinion I'll throw out there (at the risk of sounding a bit militant) is that Kyt is a new tool with its own learning curve, and I don't think that using Kyt would solve the problem of making config simpler. Probably less SLOC in the git tree, sure: but the goals of a boilerplate should be to let you start a new project without having to worry about anything, while also letting you grow the project (and its config) at your own pace. Having reasonable Webpack configs solves this problem perfectly. Just my two cents!