File tree Expand file tree Collapse file tree 7 files changed +2183
-29
lines changed Expand file tree Collapse file tree 7 files changed +2183
-29
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,7 @@ vsc-extension-quickstart.md
1111create_refs.py
1212** /* .ts
1313showcase.png
14- .mypy_cache
14+ .mypy_cache
15+ node_modules
16+ esbuild.js
17+ tsconfig.json
Original file line number Diff line number Diff line change 1- # [ 1.0.0]
1+ # Changelog
2+
3+ ## [ 1.1.0]
4+
5+ - Added logo
6+ - Bundled extension to reduce size
7+
8+ ## [ 1.0.0]
29
310- Initial release
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 : 'silent' ,
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+ console . error ( ` ${ location . file } :${ location . line } :${ location . column } :` ) ;
45+ } ) ;
46+ console . log ( '[watch] build finished' ) ;
47+ } ) ;
48+ }
49+ } ;
50+
51+ main ( ) . catch ( e => {
52+ console . error ( e ) ;
53+ process . exit ( 1 ) ;
54+ } ) ;
You can’t perform that action at this time.
0 commit comments