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

webpack externals are not complete #740

Closed
gilamran opened this issue Dec 19, 2016 · 4 comments
Closed

webpack externals are not complete #740

gilamran opened this issue Dec 19, 2016 · 4 comments
Labels

Comments

@gilamran
Copy link

gilamran commented Dec 19, 2016

Hi,
In our situation we use webpack to bundle the application code into a bundle, and the external packages (Like react) we load them using a script tag (CDN). We would like to mimic that also in our tests.
But when importing enzyme in our tests, it will bundle react and react-dom into the application bundle, even after we specifically mentioned them in our externals section.

To solve this, you have to add this to the externals:

    "react": 'React',
    "react-dom": 'ReactDOM',
    "react-dom/server": true,
    "react-dom/lib/ReactTestUtils": true
@blainekasten
Copy link
Contributor

Could you throw up a PR for updating the docs?

@gilamran
Copy link
Author

Done, #744

@gilamran
Copy link
Author

gilamran commented Dec 22, 2016

I've updated the issue description to explain the situation in more detail.
The PR is not relevant anymore, a detailed explanation might be needed in the docs.

Here's a repo. to test the issue.
Tests are on the latest react 15.4.1

@ljharb
Copy link
Member

ljharb commented Sep 26, 2017

I don't think this is relevant any more now that we're on v3.

@ljharb ljharb closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants