monaco-editor
monaco-editor copied to clipboard
docs: change `var require` to `window.require`
The browser script edtior sample use var require = ...
In some senario var would be auto replaced to const (ESLint eg.). And would cause worker not found, so as other resource files.
"In some" but not all of them.
Good fix. Changing var require to window.require ensures that the require configuration is globally available for Monaco's AMD loader (loader.js). This avoids conflicts with local require definitions and aligns with how Monaco expects the global require to be defined.