monaco-editor
Version:
A browser based code editor
18 lines (15 loc) • 977 B
JavaScript
import { FileAccess, nodeModulesPath } from './base/common/network.js';
import './base/common/platform.js';
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
function resolveAmdNodeModulePath(nodeModuleName, pathInsideNodeModule) {
const product = globalThis._VSCODE_PRODUCT_JSON;
Boolean((product ?? globalThis.vscode?.context?.configuration()?.product)?.commit);
const nodeModulePath = `${nodeModuleName}/${pathInsideNodeModule}`;
const actualNodeModulesPath = (nodeModulesPath);
const resourcePath = `${actualNodeModulesPath}/${nodeModulePath}`;
return FileAccess.asBrowserUri(resourcePath).toString(true);
}
export { resolveAmdNodeModulePath };