Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { autoEsbuildOrWatch, autoSelectEsbuildConfig } from '@microsoft/vscode-azext-eng/esbuild';

const { extensionConfig, telemetryConfig } = autoSelectEsbuildConfig();
const { extensionConfig, telemetryConfig } = autoSelectEsbuildConfig(true);

/** @type {import('esbuild').BuildOptions} */
const finalConfig = {
Expand Down
18 changes: 3 additions & 15 deletions main.js → main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

"use strict";

/* eslint-disable no-undef */ // Ignore the fact that the engine (which is VSCode) is unknown by the linter

// This is the extension entrypoint, which imports extension.bundle.js, the actual extension code.
//
// This is in a separate file so we can properly measure extension.bundle.js load time.
Expand All @@ -16,22 +12,14 @@ const perfStats = {
loadEndTime: undefined
};

Object.defineProperty(exports, "__esModule", { value: true });

// eslint-disable-next-line @typescript-eslint/no-var-requires
const extension = require("./dist/extension.bundle");
const extension = await import("./dist/extension.bundle.js");

async function activate(ctx) {
export async function activate(ctx) {
return await extension.activateInternal(ctx, perfStats);
}

async function deactivate(ctx) {
export async function deactivate(ctx) {
return await extension.deactivateInternal(ctx);
}

exports.activate = activate;
exports.deactivate = deactivate;

perfStats.loadEndTime = Date.now();

/* eslint-enable no-undef */
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"onLanguage:dockerfile",
"onLanguage:dockercompose"
],
"main": "main",
"main": "main.mjs",
"module": "main.mjs",
Comment on lines +42 to +43
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to figure out if/why it's necessary to have main, when module should be sufficient...

"contributes": {
"menus": {
"commandPalette": [
Expand Down