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 @@ -52,15 +52,15 @@ const defaultIdentifierOption = (
52
52
export default function ( this : LoaderContext , source : string ) : void {
53
53
const { identifiers } = loaderUtils . getOptions ( this ) as InternalLoaderOptions ;
54
54
55
- const { name } = getPackageInfo ( this . rootContext ) ;
55
+ const packageInfo = getPackageInfo ( this . rootContext ) ;
56
56
57
57
const callback = this . async ( ) ;
58
58
59
59
transform ( {
60
60
source,
61
61
filePath : this . resourcePath ,
62
62
rootPath : this . rootContext ,
63
- packageName : name ,
63
+ packageName : packageInfo ?. name ,
64
64
identOption : defaultIdentifierOption ( this . mode , identifiers ) ,
65
65
} )
66
66
. then ( ( code ) => {
You can’t perform that action at this time.
0 commit comments