Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #936
Closed
Open
Issue created Oct 20, 2016 by Administrator@rootContributor

Cannot serve built static assets from external CDN

Created by: EnoahNetzach

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
  • Operating system: any OS
  • Browser and version: any browser

Reproducible Demo

Basic CRA setup with external files imported.

Assignee
Assign to
Time tracking