Bundle Bootstrap via Vite instead of jsDelivr CDN - #2639
Merged
Conversation
Signed-off-by: Zach Casper <[email protected]>
willdavsmith
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundle Bootstrap through the Vite build instead of loading it from the jsDelivr CDN, so the Todo list demo renders with correct styling even when an organization's Microsoft Defender policy blocks npm-backed CDN URLs.
Reason for change
client/index.htmlreferenced Bootstrap CSS and JS fromcdn.jsdelivr.net. In environments where Microsoft Defender blocks npm-backed jsDelivr URLs, the browser fails to load these resources (ERR_SOCKET_NOT_CONNECTED), so the demo loads without Bootstrap styling. Installing Bootstrap as a client dependency and importing it into the Vite bundle removes the runtime dependency on an external CDN.Fixes #2638
How to test
Build the demo image (pass an approved npm registry if the default is blocked):
docker build --build-arg NPM_CONFIG_REGISTRY="$(npm config get registry)" -t ghcr.io/radius-project/samples/demo:test ./samples/demoLoad it into a local Kind cluster and deploy:
kind load docker-image ghcr.io/radius-project/samples/demo:test --name <cluster>Edit the container image in the app.bicep to point to :test rather than :latest
Deploy
rad deploy ./samples/demo/app.bicep --application demo --environment defaultPort-forward the demo container and open it in a browser.
Confirm the UI renders with Bootstrap styling and the served HTML contains no
cdn.jsdelivr.netreferences.File change summary
index.cssimportbootstrapas a client dependencybootstrapbootstrapdependencybootstraplockfile entryNPM_CONFIG_REGISTRYbuild arg so the image can build through an approved npm registry proxy