-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Update webpack.config.js #12167
base: main
Are you sure you want to change the base?
Update webpack.config.js #12167
Conversation
Adds mdx to file loaded exclude section
Hi @zingbretsen! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
I'm blocked in my upgrade to CRA 5.0.0 by 5.0.0 making @mdx-js/loader to not work anymore and there are lots of CVEs on CRA 4.x dependencies, so can the CRA devs this please move forward? |
Might the file extension list also need to include |
Also a loader definition for |
Btw, @thediveo: If adding https://github.com/gsoft-inc/craco to your project(s) is acceptable for you, then you could use mdx-js/mdx#1870 (comment) as a (temporary) workaround … |
CRACO unfortunately claims only CRA 4.x support. Do you have experience with it on CRA 5.0? So far, I wanted to avoid bringing in even more configuration-related mechanisms into what appears to be already a highly brittle construction. |
Some parts of the CRACO API are not fully compatible w/CRA 5 yet; but so far all runner scripts work—as well as those features needed for the workaround … |
In addition to or instead of the current change? |
Hmm … actually instead, @zingbretsen When extending the And when defining the loader—internally or externally—I've figured meanwhile out that you don't need to extend the So I think now it'd be best to just extend the |
What's your opinion on all of this, @iansu & @mrmckeb? [Update] I should've read https://mdxjs.com/docs/getting-started/#create-react-app-cra more carefully … |
I added md to the excludes list in addition to mdx. I'll defer to actual JS devs if you want any other changes as part of the PR. |
But anyway—I'm still curious: Did you really need to use the webpack |
I think so, here's an example of it: integrated help in lxkns service web UI. Please note that I'm using the "all-batteries-included" |
Adds mdx to file loader exclude section
Addresses this issue: #12166
Just edits one line in the webpack config from react-scripts as suggested here:
mdx-js/mdx#1870 (comment)
I made the edit in my local version of
webpack.config.js
inreact-scripts
which is installed in my project, and that is sufficient to get mdx to work with no errors.I don't know what other ramifications this might have. I'm not a JS dev, but this solution worked for my problem.