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 @@ -49,15 +49,15 @@ const defaultIdentifierOption = (
4949export default function ( this : LoaderContext , source : string ) {
5050 const { identifiers } = loaderUtils . getOptions ( this ) as InternalLoaderOptions ;
5151
52- const { name } = getPackageInfo ( this . rootContext ) ;
52+ const packageInfo = getPackageInfo ( this . rootContext ) ;
5353
5454 const callback = this . async ( ) ;
5555
5656 transform ( {
5757 source,
5858 filePath : this . resourcePath ,
5959 rootPath : this . rootContext ,
60- packageName : name ,
60+ packageName : packageInfo ?. name ,
6161 identOption : defaultIdentifierOption ( this . mode , identifiers ) ,
6262 } )
6363 . then ( ( code ) => {
You can’t perform that action at this time.
0 commit comments