Skip to content
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

Dedicated webpack.config.js without ejecting #6100

Closed
Larkenx opened this issue Dec 28, 2018 · 3 comments
Closed

Dedicated webpack.config.js without ejecting #6100

Larkenx opened this issue Dec 28, 2018 · 3 comments

Comments

@Larkenx
Copy link

Larkenx commented Dec 28, 2018

Feature Request

After using the new vue-cli 3 for a hobby project, I think it would be great if create-react-app could follow suite with something similar to its webpack configuration, see https://cli.vuejs.org/guide/webpack.html#simple-configuration.

The tldr is that we could add a webpack.config.js to the root of the project folder that's optional, and it accepts the webpack modules and we can chain / configure webpack without ejecting. This is great because really, the only customized pieces I need for webpack for my purposes are:

  1. Webpack aliasing
  2. Adding some custom webpack loaders

I've come to a really annoying standstill with the create-react-app because I can't load markdown files - I need to manually add a raw-loader so I can use markdown-to-jsx (see #3722 ). I don't want to sacrifice ejecting my create-react-app that will break future versions of webpack for example - but I need to have some sort of customization of webpack configuration. Thoughts?

@Larkenx Larkenx changed the title Webpack Config Dedicated webpack.config.js without ejecting Dec 28, 2018
@heyimalex
Copy link
Contributor

This idea gets brought up a lot, so you should check the issue tracker for other responses that put it more eloquently, but the gist is probably not. The reasoning is that exposing custom hooks to webpack makes create-react-app's api as large as webpack's. How can cra make compatibility guarantees if you can use every feature of the version of webpack it currently bundles? webpack is expressly not a part of cra's public api for that reason.

@Larkenx
Copy link
Author

Larkenx commented Dec 28, 2018

I haven’t done that much research but from what I can see, vue-cli uses https://github.com/neutrinojs/webpack-chain.

Using that same library, it sounds like CRA could add this feature with the expectation that it doesn’t expand its own public api so to speak, but leverages that library to manage webpack configuration chaining.

@bugzpodder
Copy link

We currently have several other discussions regarding this: #6303

@lock lock bot locked and limited conversation to collaborators Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants