1
- const { build } = require ( " esbuild" ) ;
1
+ const { build } = require ( ' esbuild' )
2
2
const { sassPlugin } = require ( 'esbuild-sass-plugin' )
3
- const { nodeExternalsPlugin } = require ( 'esbuild-node-externals' ) ;
3
+ const { nodeExternalsPlugin } = require ( 'esbuild-node-externals' )
4
4
5
- const entryFile = " src/index.ts" ;
5
+ const entryFile = ' src/index.ts'
6
6
const shared = {
7
- bundle : true ,
8
- entryPoints : [ entryFile ] ,
9
- logLevel : "info" ,
10
- minify : true ,
11
- sourcemap : true ,
12
- plugins : [ sassPlugin ( ) , nodeExternalsPlugin ( ) ]
13
- } ;
7
+ bundle : true ,
8
+ entryPoints : [ entryFile ] ,
9
+ logLevel : 'info' ,
10
+ minify : true ,
11
+ sourcemap : true ,
12
+ plugins : [ sassPlugin ( ) , nodeExternalsPlugin ( ) ] ,
13
+ loader : {
14
+ '.svg' : 'file' ,
15
+ } ,
16
+ }
14
17
15
18
build ( {
16
- ...shared ,
17
- format : " esm" ,
18
- outfile : " ./dist/index.esm.js" ,
19
- target : [ " esnext" , " node12.22.0" ] ,
20
- } ) ;
19
+ ...shared ,
20
+ format : ' esm' ,
21
+ outfile : ' ./dist/index.esm.js' ,
22
+ target : [ ' esnext' , ' node12.22.0' ] ,
23
+ } )
21
24
22
25
build ( {
23
- ...shared ,
24
- format : " cjs" ,
25
- outfile : " ./dist/index.cjs.js" ,
26
- target : [ " esnext" , " node12.22.0" ] ,
27
- } ) ;
26
+ ...shared ,
27
+ format : ' cjs' ,
28
+ outfile : ' ./dist/index.cjs.js' ,
29
+ target : [ ' esnext' , ' node12.22.0' ] ,
30
+ } )
0 commit comments