Confused on what is happening on your configs
Some are straight forward, but some are not, especially on production, I don't know where is the index file.. I have to resort to reading source code for learning, waaah, I hope the react-starter will improve.
Was there anyway, that you don't have to build then deploy? I can see that you have to run a command, followed by another?
Also, if I weren't using express-node for launching server, wouldn't it be good, if on production, there's a dist file, were index.html lives there, along with its resources?
I'm in agreement. I'm more in favor of removing the dynamic features from these configs. There should be one default config and each derivation directly overrides the configuration options.
It just takes forever to read and understand what's going on.
Does this HowStuffWorks.md file help?
https://github.com/webpack/react-starter/pull/51
I agree the config files are a beast. But i also consider this the ultimate webpack example, by the webpack author actually. I'd rather learn from it than have it "dumbed down". There are plenty of simple webpack examples.
:+1: Code duplication in config files is absolutely normal. Much more better than imperative instructions. Configs are meant to be compared with diff tools to inspect the difference. Here we have basically 3 presets: prod, dev and prerender squashed in one imperative obscure chunk of code. Funny thing, when I replaced all imperative statements with declarative "duplication" the overall size didn't extended too much, but transparency raised in a factor of 10. There is definitely much to learn but I bet everyone here started to learn by refactoring :laughing:
@ivan-kleshnin Care to share your refactor?
@pikeas sure, here is raw a version https://github.com/Paqmind/starter. Just correct retranslation of imperative syntax to declarative.
A newer variation of it is used here https://github.com/Paqmind/react-ultimate It do not have isomorphic rendering working and some other things are disabled because of 3-rd party limitations and bugs but it should be good as a starting point anyway.