File tree Expand file tree Collapse file tree 8 files changed +2154
-27
lines changed Expand file tree Collapse file tree 8 files changed +2154
-27
lines changed Original file line number Diff line number Diff line change 3131 run : npm install
3232
3333 - name : Run linter
34- run : npm run lint
34+ run : npm run pretest
3535
3636 - name : Setup headless display (Linux only)
3737 if : runner.os == 'Linux'
Original file line number Diff line number Diff line change 33 // for the documentation about the extensions.json format
44 "recommendations" : [
55 " dbaeumer.vscode-eslint" ,
6- " ms-vscode.extension-test-runner"
6+ " ms-vscode.extension-test-runner" ,
7+ " connor4312.esbuild-problem-matchers"
78 ]
89}
Original file line number Diff line number Diff line change 44 "version" : " 2.0.0" ,
55 "tasks" : [
66 {
7- "type" : " npm" ,
8- "script" : " watch" ,
9- "problemMatcher" : " $tsc-watch" ,
10- "isBackground" : true ,
7+ "label" : " watch" ,
8+ "dependsOn" : [
9+ " npm: watch:tsc" ,
10+ " npm: watch:esbuild"
11+ ],
1112 "presentation" : {
1213 "reveal" : " never"
1314 },
1415 "group" : {
1516 "kind" : " build" ,
1617 "isDefault" : true
1718 }
19+ },
20+ {
21+ "type" : " npm" ,
22+ "script" : " watch:esbuild" ,
23+ "group" : " build" ,
24+ "problemMatcher" : " $esbuild-watch" ,
25+ "isBackground" : true ,
26+ "label" : " npm: watch:esbuild" ,
27+ "presentation" : {
28+ "group" : " watch" ,
29+ "reveal" : " never"
30+ }
31+ },
32+ {
33+ "type" : " npm" ,
34+ "script" : " watch:tsc" ,
35+ "group" : " build" ,
36+ "problemMatcher" : " $tsc-watch" ,
37+ "isBackground" : true ,
38+ "label" : " npm: watch:tsc" ,
39+ "presentation" : {
40+ "group" : " watch" ,
41+ "reveal" : " never"
42+ }
1843 }
1944 ]
2045}
Original file line number Diff line number Diff line change @@ -9,3 +9,13 @@ vsc-extension-quickstart.md
99** /* .map
1010** /* .ts
1111** /.vscode-test. *
12+
13+ .vscode
14+ node_modules
15+ out /
16+ src /
17+ tsconfig.json
18+ webpack.config.js
19+ esbuild.js
20+
21+ .github /
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 0.0.4] - 2025-07-30
9+
10+ ### Changed
11+
12+ - Changed bundler to esbuild for more optimization
13+
814## [ 0.0.3] - 2025-07-30
915
1016### Changed
Original file line number Diff line number Diff line change 1+ const esbuild = require ( 'esbuild' ) ;
2+
3+ const production = process . argv . includes ( '--production' ) ;
4+ const watch = process . argv . includes ( '--watch' ) ;
5+
6+ async function main ( ) {
7+ const ctx = await esbuild . context ( {
8+ entryPoints : [ 'src/extension.ts' ] ,
9+ bundle : true ,
10+ format : 'cjs' ,
11+ minify : production ,
12+ sourcemap : ! production ,
13+ sourcesContent : false ,
14+ platform : 'node' ,
15+ outfile : 'dist/extension.js' ,
16+ external : [ 'vscode' ] ,
17+ logLevel : 'warning' ,
18+ plugins : [
19+ /* add to the end of plugins array */
20+ esbuildProblemMatcherPlugin
21+ ]
22+ } ) ;
23+ if ( watch ) {
24+ await ctx . watch ( ) ;
25+ } else {
26+ await ctx . rebuild ( ) ;
27+ await ctx . dispose ( ) ;
28+ }
29+ }
30+
31+ /**
32+ * @type {import('esbuild').Plugin }
33+ */
34+ const esbuildProblemMatcherPlugin = {
35+ name : 'esbuild-problem-matcher' ,
36+
37+ setup ( build ) {
38+ build . onStart ( ( ) => {
39+ console . log ( '[watch] build started' ) ;
40+ } ) ;
41+ build . onEnd ( result => {
42+ result . errors . forEach ( ( { text, location } ) => {
43+ console . error ( `✘ [ERROR] ${ text } ` ) ;
44+ if ( location == null ) return ;
45+ console . error ( ` ${ location . file } :${ location . line } :${ location . column } :` ) ;
46+ } ) ;
47+ console . log ( '[watch] build finished' ) ;
48+ } ) ;
49+ }
50+ } ;
51+
52+ main ( ) . catch ( e => {
53+ console . error ( e ) ;
54+ process . exit ( 1 ) ;
55+ } ) ;
You can’t perform that action at this time.
0 commit comments