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 #780

Closed
tbillington opened this issue Sep 27, 2016 · 4 comments
Closed

Webpack externals #780

tbillington opened this issue Sep 27, 2016 · 4 comments

Comments

@tbillington
Copy link

tbillington commented Sep 27, 2016

Is there an easy way to add external dependencies to create-react-app without ejecting?

I'm including a google analytics script in the header of index.html. Currently I'm modifying the webpack scripts in react-scripts in node_modules to add the external dep so I can access the ga function in my app to send events.

@gaearon
Copy link
Contributor

gaearon commented Sep 27, 2016

Not currently, and this particular feature is unlikely to be added.
I see two options here:

@gaearon gaearon closed this as completed Sep 27, 2016
@tbillington
Copy link
Author

Makes sense, thanks :)

@guilhermebruzzi
Copy link
Contributor

@gaearon In our case, we use react and redux from a CDN, because our product is used everyday by the same users and we like to benefit from caching our main dependencies.
Without external support (making import React from 'react' work from the CDN instead of node_modules), we cant move to use react-scripts instead of our custom webpack.
There is any workaround for this?

@Timer
Copy link
Contributor

Timer commented Sep 13, 2017

Not currently, but please follow #2758.

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

4 participants