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

Add ability to configure Webpack plugins without eject #1592

Closed
shai32 opened this issue Feb 20, 2017 · 4 comments
Closed

Add ability to configure Webpack plugins without eject #1592

shai32 opened this issue Feb 20, 2017 · 4 comments

Comments

@shai32
Copy link

shai32 commented Feb 20, 2017

I am missing 2 things that I like in my project and I don't want to eject.

  1. Eslint Auto fix
  2. StyleLint

adding them can be done with a simple configuration in webpack.

plugins: [
new StyleLintPlugin(),
new webpack.LoaderOptionsPlugin({
options: {
eslint: { fix: true },
},
}),
]

can we add plugins to webpack without eject?

@viankakrisna
Copy link
Contributor

@shai32 No. There's been a lot of discussion regarding this, we don't currently expose webpack config to user, if you don't want to eject, you can maintain a fork https://medium.com/@shubheksha/tweaking-configuration-for-react-scripts-in-create-react-app-d91e9d03a42f#.wrtg9nbb1. This decision is made so we can transparently move to other module bundler without affecting external api. If you try other hacks to configure cra's webpack config, it's not guaranteed that the hack will work when react-scripts update.

I think if you are comfortable with webpack you can just fork or eject :)

@shai32
Copy link
Author

shai32 commented Feb 20, 2017

Ok, I agree with this approach.

@gaearon
Copy link
Contributor

gaearon commented Feb 20, 2017

Also feel free to search issues before creating a new one 😉

#99 #145 #460 #481 #1060 #1103 #1111 #1308

@gaearon gaearon closed this as completed Feb 20, 2017
@gaearon
Copy link
Contributor

gaearon commented Feb 20, 2017

Eslint Auto fix

Autofix has known problems with eslint-loader, sometimes entering infinite cycles. I would not recommend using it in this setup. It also wouldn't be very useful because our lint rules intentionally don't include any style rules. For enforcing style, I recommend you to try Prettier which works fine without ejecting.

StyleLint

You can express support for it in this PR: #1216.

@lock lock bot locked and limited conversation to collaborators Jan 22, 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