From c94bd42ddef50136dc81e88e0bc3b37155b37cf3 Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Thu, 19 Aug 2021 16:05:47 -0500 Subject: [PATCH 1/3] chore: Build with esbuild --- .vscode/tasks.json | 7 ++----- package.json | 6 ++++-- yarn.lock | 10 ++++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9a3618d..d164d63 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,12 +5,9 @@ "tasks": [ { "type": "npm", - "script": "ts:watch", - "problemMatcher": "$tsc-watch", + "script": "watch", + "problemMatcher": [], "isBackground": true, - "presentation": { - "reveal": "never" - }, "group": { "kind": "build", "isDefault": true diff --git a/package.json b/package.json index 82b03f7..b5678ca 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,13 @@ "vscode" ], "scripts": { + "build": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node", "lint": "eslint .", "theme": "ts-node ./generator/index.ts", "theme:watch": "nodemon ./generator/index.ts", "ts": "tsc", - "ts:watch": "yarn ts -w", - "vscode:prepublish": "yarn theme && yarn ts" + "watch": "yarn build --sourcemap --watch", + "vscode:prepublish": "yarn theme && yarn build --minify" }, "engines": { "vscode": "^1.42.0" @@ -96,6 +97,7 @@ "@types/vscode": "^1.42.0", "@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/parser": "^4.16.1", + "esbuild": "^0.12.21", "eslint": "^7.21.0", "eslint-plugin-sort": "^1.5.0", "nodemon": "^2.0.7", diff --git a/yarn.lock b/yarn.lock index a8186f1..5ff9860 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2511,6 +2511,15 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:^0.12.21": + version: 0.12.21 + resolution: "esbuild@npm:0.12.21" + bin: + esbuild: bin/esbuild + checksum: b7f4839ba9dfb2e2c2fefd96bda6d6d82cc21e494120a72e9571bf74bc13796b884b04bc216dc8aaaba7cece5ef6ea6bba4a99e00abd3c6d713d4b2ea6a5e39c + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -5639,6 +5648,7 @@ fsevents@~2.1.2: "@types/vscode": ^1.42.0 "@typescript-eslint/eslint-plugin": ^4.16.1 "@typescript-eslint/parser": ^4.16.1 + esbuild: ^0.12.21 eslint: ^7.21.0 eslint-plugin-sort: ^1.5.0 nodemon: ^2.0.7 From ffa8199fb027a99e8da5de343ff981386c0e8c2c Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Thu, 19 Aug 2021 16:09:26 -0500 Subject: [PATCH 2/3] fix: Update entrypoint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5678ca..842f2c7 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "ui", "workspace" ], - "main": "./out/extension.js", + "main": "./out/main.js", "contributes": { "themes": [ { From 845163ef921b2aaf6c4872363f76c20900df02cc Mon Sep 17 00:00:00 2001 From: Mark Skelton Date: Thu, 19 Aug 2021 16:12:05 -0500 Subject: [PATCH 3/3] feat: Swtich to `onStartupFinished` activation event for better performance --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 842f2c7..19ec5f0 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "theme": "dark" }, "activationEvents": [ - "*" + "onStartupFinished" ], "extensionKind": [ "ui",