-
-
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
Cannot serve built static assets from external CDN #936
Comments
I’d take a PR that implements this via reading |
That's perfect, so btw: thank y'all for your work, time & dedication! |
How about namespacing this as |
Any news on this issue? |
It is already available as |
Is there a clear explanation of how this will work? Here's what I tried:
ExpectedAll references to static media would be structured with absolute references (i.e. ActualAll links were still relative: |
@sjmueller in my experience it won't work after a The steps to follow to reproduce in your case are:
|
@gaearon if I could ask, why this issue is in the |
Sorry, both should be tagged as 0.9.0 now. |
@gaearon ahah sorry for the psychological terrorism! |
Hi @EnoahNetzach! This is out in 0.9.0. |
this facebook worker thing is useless: facebook/create-react-app#936
Description
We have a SPA served from an AWS server (e.g. "
https://s3.eu-central-1.amazonaws.com/...
") but used on our domain (e.g.https://www.mydomain.com/...
); we have some.svg
files bundled within and our package.json "homepage
" is set to the AWS url.The
.js
and.css
assets are retrieved correctly from AWS, but the browser tries to retrieve the.svg
files from our domain, and of course it fails since they are hosted on the AWS server.Expected behavior
Assets built in
build/static/media/*
are resolved from the domain specified in the package.json "homepage
" value (i.e. "https://s3.eu-central-1.amazonaws.com/...
").Actual behavior
Static assets are resolved from the domain where the
main.[hash].js
is being loaded from (i.e. "https://www.mydomain.com/...
").Environment
npm ls react-scripts
:react-scripts@0.6.1
node -v
:v6.8.0
npm -v
:3.10.8
Reproducible Demo
Basic CRA setup with external files
import
ed.The text was updated successfully, but these errors were encountered: