Skip to content
Open
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 keep-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "next.config.js",
"scripts": {
"build-monaco-workers": "node scripts/build-monaco-workers-turbopack.js",
"build": "./next_build.sh",
"build": "npm run build-monaco-workers && ./next_build.sh",
"build:workflow-yaml-json-schema": "ts-node -P tsconfig.scripts.json scripts/generate-workflow-yaml-json-schema.ts",
"dev": "npm run build-monaco-workers && next dev --turbopack -p 3000",
"dev:webpack": "next dev -p 3000",
Expand Down
15 changes: 15 additions & 0 deletions keep-ui/shared/ui/MonacoCELEditor/MonacoCel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ interface MonacoCelProps extends EditorProps {
const monacoConfigPromise: Promise<void> | null =
typeof window !== "undefined"
? import("monaco-editor").then((monaco) => {
// Workers are pre-built into public/monaco-workers by the
// build-monaco-workers script; Next.js standalone output doesn't
// trace the workers webpack emits from node_modules, so they are
// missing from the production Docker image otherwise.
self.MonacoEnvironment = {
getWorkerUrl: (_moduleId: string, label: string) => {
if (label === "json") {
return "/monaco-workers/json.worker.js";
}
if (label === "yaml") {
return "/monaco-workers/yaml.worker.js";
}
return "/monaco-workers/editor.worker.js";
},
};
loader.config({ monaco });
})
: null;
Expand Down
Loading