Load monaco from packages not CDN #12760
Merged
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.
Description
By default
@monaco-editor/react
loads the monaco library from a CDN (throughmonaco-loader
). Normally this would be fine but it means Sandcastle would be unusable when not connected to an external network.This PR sets up the loader config to make sure we use the local packaged version of monaco so Sandcastle works offline and in isolated networks.
The config is set up using the guidance in the
monaco-editor/react
readme forvite
I also copied over the
Offline
sandcastle from #12752 for testingIssue number and link
Part of #12566
Testing plan
npm run dev
from inside the sandcastle package ornpm run build-sandcastle
andnpm start
from the root packagehttp://localhost:5173/index.html?id=offline
orhttp://localhost:8080/Apps/Sandcastle2/index.html?id=offline
depending how you started it-url:localhost
to make sure there are no external requestsAuthor checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change