Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/diff-explorer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function loadMonaco(baseUrl: string): Promise<Bundle> {
link.rel = "stylesheet";
link.href = `${baseUrl}/editor.css`;
document.head.appendChild(link);
(globalThis as any).MonacoEnvironment = {
(globalThis as any).DiffExplorerMonacoEnvironment = {
getWorker: () => new Worker(new URL(`${baseUrl}/editor.worker.js`, window.location.origin), { type: "module" }),
};
const bundle: Bundle = await import(/* @vite-ignore */ `${baseUrl}/editor.js`);
Expand Down
2 changes: 1 addition & 1 deletion plugins/diff-explorer/monaco/editor.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugins/diff-explorer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/diff-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bb-plugin-diff-explorer",
"version": "0.1.2",
"version": "0.1.3",
"type": "module",
"private": true,
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion plugins/diff-explorer/scripts/build-monaco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ grep -v -E 'languages/features/|__src_languages_features|monaco-lsp-client|index
echo "export * as monaco from '$src/editor.api.js';" >>"$entry"
echo "export { createMultiDiffEditor } from '$PWD/scripts/multi-diff.js';" >>"$entry"
rm -rf monaco
npx esbuild "$entry" --bundle --format=esm --minify --loader:.ttf=file --outfile=monaco/editor.js --log-level=warning
# BB's built-in File Editor loads its own Monaco and overwrites globalThis.MonacoEnvironment; read a private global instead.
npx esbuild "$entry" --bundle --format=esm --minify --loader:.ttf=file --define:globalThis.MonacoEnvironment=globalThis.DiffExplorerMonacoEnvironment --outfile=monaco/editor.js --log-level=warning
npx esbuild "$src/editor.worker.js" --bundle --format=esm --minify --outfile=monaco/editor.worker.js --log-level=warning
cp node_modules/monaco-editor/LICENSE node_modules/monaco-editor/ThirdPartyNotices.txt monaco/
Loading