File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,17 @@ export default function (opts: NodePolyfillsOptions = {}) {
9
9
include : opts . include ,
10
10
exclude : opts . exclude ,
11
11
modules : {
12
- 'process' : 'process' ,
13
- 'Buffer' : [ 'buffer' , 'Buffer' ] ,
14
- 'global' : GLOBAL_PATH ,
15
- '__filename' : FILENAME_PATH ,
16
- '__dirname' : DIRNAME_PATH ,
12
+ 'process' : 'process' ,
13
+ 'Buffer' : [ 'buffer' , 'Buffer' ] ,
14
+ 'global' : GLOBAL_PATH ,
15
+ '__filename' : FILENAME_PATH ,
16
+ '__dirname' : DIRNAME_PATH ,
17
17
}
18
18
} ) ;
19
19
const basedir = opts . baseDir || '/' ;
20
20
const dirs = new Map < string , string > ( ) ;
21
21
const resolver = builtinsResolver ( opts ) ;
22
22
return {
23
- ...injectPlugin ,
24
23
name : 'node-polyfills' ,
25
24
resolveId ( importee : string , importer : string ) {
26
25
if ( importee === DIRNAME_PATH ) {
@@ -39,6 +38,9 @@ export default function (opts: NodePolyfillsOptions = {}) {
39
38
if ( dirs . has ( id ) ) {
40
39
return `export default '${ dirs . get ( id ) } '` ;
41
40
}
41
+ } ,
42
+ transform ( code : string , id : string ) {
43
+ return injectPlugin . transform . call ( this , code , id ) ;
42
44
}
43
45
} ;
44
46
}
You can’t perform that action at this time.
0 commit comments