Skip to content
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

Closed
sangmokh opened this issue May 6, 2021 · 0 comments
Milestone

Comments

@sangmokh
Copy link
Contributor

sangmokh commented May 6, 2021

Background

Since 0.22.0 version of monaco-editor, the ESM version of the editor does no longer define a global monaco object unless global.MonacoEnvironment = { globalAPI: true } is set. Change log at
https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md#0220-29012021

However, global.MonacoEnvironment = { globalAPI: true } approach does not work when using monaco-editor-webpack-plugin because MonacoEnvironment is specified inside the webpack plugin. Even if we set global.MonacoEnvironment = { globalAPI: true } in the entry point JS file, it gets ignored/overwritten.

Proposed solution

@sangmokh sangmokh changed the title Unable to use global.MonacoEnvironment = { globalAPI: true } to define a global API object monaco Unable to use global.MonacoEnvironment = { globalAPI: true } to define a global monaco object May 6, 2021
@alexdima alexdima added this to the April 2021 milestone May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants