-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Merge Webpack configs #2525
Comments
If you just want to add typescript you could use https://github.com/wmonk/create-react-app-typescript |
TS is just an example, obv it can be CSS modules, or other modifications that apply to both dev and prod |
I am generally supporting of migrating to Webpack 2's env feature for this. |
Do you mean https://webpack.js.org/guides/environment-variables/ (which is basically my current approach, but with NODE_ENV detection instead of separate entry files) or something |
I mean this: https://webpack.js.org/guides/migrating/#using-custom-arguments-in-cli-and-configuration. Although now that I think of it, it won't really help because we don't use the CLI. But maybe we can use the same format: one |
Then it's basically just the same thing I have (see the gist in the issue
body)?
…On Fri, Jun 23, 2017 at 5:35 PM Dan Abramov ***@***.***> wrote:
I mean this:
https://webpack.js.org/guides/migrating/#using-custom-arguments-in-cli-and-configuration.
Although now that I think of it, it won't really help because we don't use
the CLI. But maybe we can use the same format: one webpack.config.js that
exports a function taking env.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2525 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgGCAf-Tbxvd1LwUfBxBfAsExYSp_vYks5sG80lgaJpZM4N4R7y>
.
|
Yep, same thing. |
So want me to PR it? Can do tonight
…On Mon, Jun 26, 2017 at 9:45 PM Dan Abramov ***@***.***> wrote:
Yep, same thing.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2525 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgGCEb9s5IW2YCHnGQoeHlvYjY7MiAxks5sH_xWgaJpZM4N4R7y>
.
|
Love to see this. We don't want to maintain |
@vinhlh This is not what this issue was about. |
I'll close as stale. |
Sorry if this was discussed before, I tried searching the issues and didn't find any match.
There are not so many differences between the webpack configs (dev / prod) and I have the working example (https://gist.github.com/emirotin/4ee74e426b20055e418a0101d754f8be) where they're merged into a single factory.
Then the entry configs just look like:
If this is interesting I can send a PR.
Why is it useful?
On a regular basis, I have to eject because I need TS support. This means at least adding a loader (same for dev and prod) and updating the list of extensions.
Quite often I also want to play a bit with some plugins configuration and then need to replicate these changes in prod config.
The text was updated successfully, but these errors were encountered: