File tree Expand file tree Collapse file tree 4 files changed +129
-125
lines changed Expand file tree Collapse file tree 4 files changed +129
-125
lines changed Original file line number Diff line number Diff line change 10
10
branches : [main]
11
11
12
12
jobs :
13
- build :
13
+ test :
14
14
runs-on : ubuntu-latest
15
15
16
16
strategy :
24
24
uses : actions/setup-node@v4
25
25
with :
26
26
node-version : ${{ matrix.node-version }}
27
-
28
- - name : Get yarn cache directory path
29
- id : yarn-cache-dir-path
30
- run : echo "::set-output name=dir::$(yarn config get cacheFolder)"
31
-
32
- - uses : actions/cache@v4
33
- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
34
- with :
35
- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
36
- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37
- restore-keys : |
38
- ${{ runner.os }}-yarn-
27
+ cache : ' yarn'
39
28
40
29
- name : Install dependencies
41
30
run : yarn install --immutable
46
35
- name : Test unit
47
36
run : yarn workspace esbuild-node-externals test
48
37
49
- - name : Test examples ( integration)
38
+ - name : Test integration esbuild@default
50
39
run : yarn workspace example-basic build
40
+
41
+ - name : Test integration esbuild@0.12 (minimal)
42
+ run : |
43
+ yarn workspace example-basic add esbuild@0.12
44
+ yarn workspace example-basic build
Original file line number Diff line number Diff line change 31
31
"tslib" : " ^2.4.1"
32
32
},
33
33
"peerDependencies" : {
34
- "esbuild" : " 0.12 - 0.23 "
34
+ "esbuild" : " 0.12 - 0.24 "
35
35
},
36
36
"devDependencies" : {
37
37
"@types/node" : " ^18.15.10" ,
38
- "esbuild" : " ^0.23 .0" ,
38
+ "esbuild" : " ^0.24 .0" ,
39
39
"rimraf" : " ^4.4.1" ,
40
40
"typescript" : " ^4.9.4"
41
41
}
Original file line number Diff line number Diff line change 1
1
const esbuild = require ( 'esbuild' ) ;
2
2
const { nodeExternalsPlugin } = require ( 'esbuild-node-externals' ) ;
3
3
4
- esbuild . build ( {
5
- entryPoints : [ 'src/index.js' ] ,
6
- bundle : true ,
7
- platform : 'node' ,
8
- outfile : 'dist/index.js' ,
9
- plugins : [ nodeExternalsPlugin ( ) ] ,
10
- } ) ;
4
+ ( async ( ) => {
5
+ try {
6
+ await esbuild . build ( {
7
+ entryPoints : [ 'src/index.js' ] ,
8
+ bundle : true ,
9
+ platform : 'node' ,
10
+ outfile : 'dist/index.js' ,
11
+ plugins : [ nodeExternalsPlugin ( ) ] ,
12
+ } ) ;
13
+ console . log ( `Built with ${ esbuild . version } ` )
14
+ process . exit ( 0 ) ;
15
+ }
16
+ catch ( e ) {
17
+ console . error ( e ) ;
18
+ process . exit ( 1 ) ;
19
+ }
20
+ } ) ( )
You can’t perform that action at this time.
0 commit comments