mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-16 21:31:01 +01:00
59240b668c
This prevents this annoying warning from getting printed all the time ``` [watch-copilot ] [watch:esbuild ] (node:12319) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/matb/projects/vscode/extensions/copilot/.esbuild.ts is not specified and it doesn't parse as CommonJS. [watch-copilot ] [watch:esbuild ] Reparsing as ES module because module syntax was detected. This incurs a performance overhead. [watch-copilot ] [watch:esbuild ] To eliminate this warning, add "type": "module" to /Users/matb/projects/vscode/extensions/copilot/package.json. [watch-copilot ] [watch:esbuild ] (Use `node --trace-warnings ...` to show where the warning was created) ``` Co-authored-by: Copilot <copilot@github.com>
17 lines
895 B
JavaScript
17 lines
895 B
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
// You might think this is weird. It is weird.
|
|
//
|
|
// VS Code must know where require calls happen in order to attribute them to
|
|
// the right extension (and check proposed API access.) It does this by checking
|
|
// the path of the require'ing module, and this fails once we go out of the
|
|
// directory and request the simulation workbench.
|
|
//
|
|
// This is pulled in via .esbuild.mts which shims the vscode module.
|
|
globalThis.COPILOT_SIMULATION_VSCODE = require('vscode');
|
|
|
|
exports.activate = require(process.env.VSCODE_SIMULATION_EXTENSION_ENTRY);
|