This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Unable to use global.MonacoEnvironment = { globalAPI: true }
to define a global monaco object
#146
Milestone
Background
Since
0.22.0
version ofmonaco-editor
, the ESM version of the editor does no longer define a globalmonaco
object unlessglobal.MonacoEnvironment = { globalAPI: true }
is set. Change log athttps://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md#0220-29012021
However,
global.MonacoEnvironment = { globalAPI: true }
approach does not work when usingmonaco-editor-webpack-plugin
becauseMonacoEnvironment
is specified inside the webpack plugin. Even if we setglobal.MonacoEnvironment = { globalAPI: true }
in the entry point JS file, it gets ignored/overwritten.Proposed solution
globalAPI
option (boolean) to specify whether the editor API should be exposed through a globalmonaco
object or not. The option defaults tofalse
to preserve the current behavior of the webpack plugin.The text was updated successfully, but these errors were encountered: