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 = {
1919 } ;
2020 }
2121
22- const { name : packageName } = getPackageInfo ( options . config . rootDir ) ;
22+ const packageInfo = getPackageInfo ( options . config . rootDir ) ;
2323
2424 const code = transformSync ( {
2525 source,
2626 filePath,
2727 rootPath : options . config . rootDir ,
28- packageName : packageName ,
28+ packageName : packageInfo ?. name ,
2929 identOption : 'debug' ,
3030 } ) ;
3131
Original file line number Diff line number Diff line change @@ -52,15 +52,15 @@ const defaultIdentifierOption = (
5252export default function ( this : LoaderContext , source : string ) : void {
5353 const { identifiers } = loaderUtils . getOptions ( this ) as InternalLoaderOptions ;
5454
55- const { name } = getPackageInfo ( this . rootContext ) ;
55+ const packageInfo = getPackageInfo ( this . rootContext ) ;
5656
5757 const callback = this . async ( ) ;
5858
5959 transform ( {
6060 source,
6161 filePath : this . resourcePath ,
6262 rootPath : this . rootContext ,
63- packageName : name ,
63+ packageName : packageInfo ?. name ,
6464 identOption : defaultIdentifierOption ( this . mode , identifiers ) ,
6565 } )
6666 . then ( ( code ) => {
You can’t perform that action at this time.
0 commit comments