Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Make it possible to use external deployUrl with inlineCriticalCss: true #2019

@jakubsobel

Description

@jakubsobel

🚀 Feature request

What modules are relevant for this feature request?

  • aspnetcore-engine
  • builders
  • common
  • express-engine
  • hapi-engine

Description

Currently using external deployUrl i.e. https://xyz.cloudfront.net with inlineCriticalCss: true will cause an error:
Unable to locate stylesheet: /dist/browser/https:/xyz.cloudfront.net/styles.css

It looks like currently Universal is trying to get the styles.css file from the local filesystem based on the style declaration in index.html file. In case of above example this line will be: <link rel="stylesheet" href="https://xyz.cloudfront.net/styles.css">

Describe the solution you'd like

My build process is uploading all of the assets to the cloudfront, but I still have the output browser files in the local filesystem. So just being able to manually set a path to style.css file would solve problem for me. Something like:

inlineCriticalCss: true,
cssPath: '/dist/browser/styles.css'

Other solution would be to fetch the CSS file from the external server if the external URL is found for the styles.css in the index.html file.

Describe alternatives you've considered

Currently I'm using a following workaround: I removed deployUrl from the Angular build and I'm prepending my cloudfront URL manually for the styles and scripts in the server.ts file at the runtime. Also I'm setting my cloudfront URL as __webpack_public_path__ variable in main.ts. It's not ideal, but at least it works.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions