Skip to content
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

CDN support improvements #1125

Open
vsevolodbvd opened this issue Jul 17, 2019 · 1 comment
Open

CDN support improvements #1125

vsevolodbvd opened this issue Jul 17, 2019 · 1 comment

Comments

@vsevolodbvd
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@vsevolodbvd and others