mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
* add global for node_modules access
* remove most usages of require.__$__nodeRequire * stop using require.nodeRequire
This commit is contained in:
10
src/bootstrap-window.js
vendored
10
src/bootstrap-window.js
vendored
@@ -112,6 +112,16 @@
|
||||
|
||||
window['MonacoEnvironment'] = {};
|
||||
|
||||
// VSCODE_GLOBALS: node_modules
|
||||
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), {
|
||||
get(target, mod) {
|
||||
if (!target[mod] && typeof mod === 'string') {
|
||||
target[mod] = (require.__$__nodeRequire ?? require)(mod);
|
||||
}
|
||||
return target[mod];
|
||||
}
|
||||
});
|
||||
|
||||
const loaderConfig = {
|
||||
baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
|
||||
'vs/nls': nlsConfig,
|
||||
|
||||
Reference in New Issue
Block a user