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

feat: add support for cdnPrefix for static assets #1191

Merged
merged 7 commits into from
Jan 6, 2022
Merged

Conversation

ivarconr
Copy link
Member

@ivarconr ivarconr commented Dec 16, 2021

note this feature is experimental.

Allows you to specify a cdnPrefix for static resource.

When specified CSS and JavaScript is loaded directly from CDN, like this:
image

Also replaces a meta tag in the index.html with the cdnPrefix, which may be utilized by the frontend code to use CDN prefix for dynamic static assets, such as images.

note this feature is experimental.
@vercel
Copy link

vercel bot commented Dec 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/unleash-team/unleash-docs/DJVUK6fmXmX62bSNathUhPUTBpii
✅ Preview: https://unleash-docs-git-feat-cdn-prefix-unleash-team.vercel.app

@github-actions
Copy link

github-actions bot commented Dec 16, 2021

Coverage report

Total coverage

Status Category Percentage Covered / Total
🟢 Statements 92.06% 4612/5010
🟢 Branches 81.02% 717/885
🟢 Functions 87.84% 1084/1234
🟢 Lines 93.91% 5242/5582

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show new covered files 🌑

Coverage of new files

Status Filename Statements Branches Functions Lines
🟢 src/lib/util/load-index-html.ts 81.82% 33.33% 100% 100%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show files with reduced coverage 🔻

Reduced coverage

Status Filename Statements Branches Functions Lines
🟢 src/lib/app.ts 81.48% 68.42% 66.67% 92.96%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from b70cfa0

@ivarconr
Copy link
Member Author

ivarconr commented Dec 17, 2021

Will not solve dynamically loaded assets:
image

src/lib/server-impl.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@FredrikOseberg FredrikOseberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool. LGTM.

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

Successfully merging this pull request may close these issues.

None yet

2 participants