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

requireEnsure override #159

Closed
taddj opened this issue Sep 5, 2019 · 4 comments
Closed

requireEnsure override #159

taddj opened this issue Sep 5, 2019 · 4 comments
Labels
❓ question Further information is requested

Comments

@taddj
Copy link

taddj commented Sep 5, 2019

Is there any way to accomplish this with customize-cra? I am trying to fix an issue as described here wojtekmaj/react-pdf#280

module.exports = function override(config) {
  config.module.rules[0].parser.requireEnsure = true
  return config
}
@with-heart
Copy link
Collaborator

with-heart commented Sep 7, 2019

Hi @taddj, you should be able to resolve your issue with something like this:

const { override, addDecoratorsLegacy } = require("customize-cra");

const enableRequireEnsure = () => config => {
  config.output.globalObject = 'this'
  config.module.rules[0].parser.requireEnsure = true
  return config
}

module.exports = override(
  addDecoratorsLegacy(),
  enableRequireEnsure(),
);

Can you let me know if that fixes your issue?

@with-heart with-heart added the ❓ question Further information is requested label Sep 7, 2019
@taddj
Copy link
Author

taddj commented Sep 9, 2019

That worked!

@with-heart
Copy link
Collaborator

Awesome! Glad that worked for you.

I've added you to our contributors list for asking a question! Thanks for taking part :)

@thomastaechoi
Copy link

I had this same issue. Thank you @with-heart 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants