Closed sthzg closed 7 years ago
Sounds like a good idea 👍
@weblogixx I've pushed the initial version for this feature in https://github.com/react-webpack-generators/generator-react-webpack/commit/68d85547c59c26a65c4da485f682c9b21f0eb5e2. I'd postpone additional features (e.g. the options proposed in the initial ticket) to a later time. IMO it is valuable even in this very basic state. Let me know what you think.
Hi @sthzg, sorry for the late reply, I was on vacation. This seems really nice to me. 👍 for also adding it to the global config loader. I think this is fine and should be integrated for v4.
@weblogixx no worries, I hope you had a great vacation. I want to make the first version of the code insertion still a bit more resilient and will then merge it into V4.
Initial functionality provided with #308
I'd like to propose the following and am interested in feedback if that would be considered useful.
Progress
config/webpack/<env_name>.js
src/config/<env_name>.js
config/webpack/index.js
Supported options (future iterations):
Functionality In the initial PR is kept simple to provide quicker integration. Further iterations can provide various finer updates, e.g.
Motivation:
In many projects I add one or more additional envs, e.g. a
lib
env that builds various component chunks to separate es5-artifacts.File Contents:
The files it creates are bare-bones, don't make any assumptions, and just provide the boilerplate for users to insert their env configuration, whatever this might be.
UI:
The namespace
react-webpack:setup:<foo>
is chosen so that we can add arbitrary setup tools in the future when the use case arises. ATM I don't know if Yeoman can by default resolve a third level, so if that doesn't work easily I would proposeyo react-webpack:setup-<foo>
instead (note the hypen-
instead of the colon:
.