mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 06:12:10 +03:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user