UNPKG

monaco-editor-core

Version:
18 lines 1.18 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { FileAccess, nodeModulesAsarPath, nodeModulesPath } from './base/common/network.js'; import * as platform from './base/common/platform.js'; export const canASAR = false; const cache = new Map(); export function resolveAmdNodeModulePath(nodeModuleName, pathInsideNodeModule) { const product = globalThis._VSCODE_PRODUCT_JSON; const isBuilt = Boolean((product ?? globalThis.vscode?.context?.configuration()?.product)?.commit); const useASAR = (canASAR && isBuilt && !platform.isWeb); const nodeModulePath = `${nodeModuleName}/${pathInsideNodeModule}`; const actualNodeModulesPath = (useASAR ? nodeModulesAsarPath : nodeModulesPath); const resourcePath = `${actualNodeModulesPath}/${nodeModulePath}`; return FileAccess.asBrowserUri(resourcePath).toString(true); } //# sourceMappingURL=amdX.js.map