Skip to content

Applications served from cdn on different host #647

Closed
@SeeThruHead

Description

@SeeThruHead

I'm in the process of converting our companies internal boilerplate into something that uses create-react-app.

We load all of our applications into html rendered by rails views in our application. Js/css/etc built by webpack is served via cdn.

In our boilerplate we look in the env for CDN_URL and set that as publicpath. This cdn url is provided in local dev by a .env file (loaded via dotenv module) and during deploys by the build server.

In trying to keep with 12 factor app methodology we don't commit these urls to the codebase.

Seems like publicpath is only currently modifiable by editing package.json.

Would it be possible to use something like REACT_APP_STATIC_URL (or any other, better name) in order to construct the publicpath for webpack?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions