fix(build): import Monaco ESM API to fix webpack nls.messages-loader error

Replace import("monaco-editor") with import("monaco-editor/esm/vs/editor/editor.api")
in MonacoEditor.tsx. The root package entry resolves to the minified bundle
(min/vs/editor/editor.main.js) which requires the monaco-editor-webpack-plugin
loader "vs/nls.messages-loader". The ESM API module has no such dependency and
satisfies loader.config({ monaco }) identically.
This commit is contained in:
diegosouzapw
2026-05-18 19:40:10 -03:00
parent 62f609755a
commit 1c4d850441

View File

@@ -11,7 +11,7 @@ const MonacoEditor = dynamic<EditorProps>(
async () => {
const [{ default: Editor, loader }, monaco] = await Promise.all([
import("@monaco-editor/react"),
import("monaco-editor"),
import("monaco-editor/esm/vs/editor/editor.api"),
]);
loader.config({ monaco });
return Editor;