Skip to content

CDN support improvements #1125

Open
Open
@vsevolodbvd

Description

@vsevolodbvd

Is your feature request related to a problem? Please describe.
Currently, we can set our CDN URL as the __ CDN_URL __ variable. This variable will be automatically used during the build process to replace assets paths in the generated assetMap (https://github.com/sysgears/apollo-universal-starter-kit/blob/master/modules/core/server-ts/middleware/website.tsx#L116).
On the other hand, we may have other assets that potentially can be used in css/scss/less files, for example:
.example { background-image: url(‘/assets/images/example.jpg’); }
or ts/js files, for example:
const exampleImage = '/assets/images/example.jpg';

Paths to all these assets aren't automatically updated when we provide the __ CDN_URL __ variable.

Describe the solution you'd like
We may try to use webpack output.publicPath (https://webpack.js.org/guides/public-path/) to implement this kind of functionality for css/scss/less files.
Also, we may add some mechanism that will replace assets paths for ts/js files based on the __ CDN_URL __ variable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions