File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ const vanillaTransformer: Transformer = {
19
19
} ;
20
20
}
21
21
22
- const { name : packageName } = getPackageInfo ( options . config . rootDir ) ;
22
+ const packageInfo = getPackageInfo ( options . config . rootDir ) ;
23
23
24
24
const code = transformSync ( {
25
25
source,
26
26
filePath,
27
27
rootPath : options . config . rootDir ,
28
- packageName : packageName ,
28
+ packageName : packageInfo ?. name ,
29
29
identOption : 'debug' ,
30
30
} ) ;
31
31
Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ const defaultIdentifierOption = (
49
49
export default function ( this : LoaderContext , source : string ) {
50
50
const { identifiers } = loaderUtils . getOptions ( this ) as InternalLoaderOptions ;
51
51
52
- const { name } = getPackageInfo ( this . rootContext ) ;
52
+ const packageInfo = getPackageInfo ( this . rootContext ) ;
53
53
54
54
const callback = this . async ( ) ;
55
55
56
56
transform ( {
57
57
source,
58
58
filePath : this . resourcePath ,
59
59
rootPath : this . rootContext ,
60
- packageName : name ,
60
+ packageName : packageInfo ?. name ,
61
61
identOption : defaultIdentifierOption ( this . mode , identifiers ) ,
62
62
} )
63
63
. then ( ( code ) => {
You can’t perform that action at this time.
0 commit comments