Cannot serve built static assets from external CDN
See original GitHub issueDescription
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
- Operating system: any OS
- Browser and version: any browser
Reproducible Demo
Basic CRA setup with external files import
ed.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:13 (12 by maintainers)
Top GitHub Comments
Resolved in #937 and #1504.
Hi @EnoahNetzach! This is out in 0.9.0.