File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
packages/repack/src/loaders Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @callstack/repack " : patch
3+ ---
4+
5+ Use consistent name as a caller for babel & swc
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export default async function babelLoader(
124124 const result = await transform (
125125 source ,
126126 {
127- caller : { name : '@callstack/repack/babel-loader ' } ,
127+ caller : { name : '@callstack/repack' } ,
128128 filename : this . resourcePath ,
129129 sourceMaps : withSourceMaps ,
130130 sourceFileName : this . resourcePath ,
Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ export default async function babelSwcLoader(
6262) {
6363 this . cacheable ( ) ;
6464 const callback = this . async ( ) ;
65- const loaderName = '@callstack/repack/babel-swc-loader' ;
6665 const logger = this . getLogger ( 'BabelSwcLoader' ) ;
6766 const options = this . getOptions ( ) ;
6867
@@ -81,7 +80,7 @@ export default async function babelSwcLoader(
8180 : this . sourceMap ;
8281
8382 const baseBabelConfig : TransformOptions = {
84- caller : { name : loaderName } ,
83+ caller : { name : '@callstack/repack' } ,
8584 root : projectRoot ,
8685 filename : this . resourcePath ,
8786 sourceMaps : withSourceMaps ,
@@ -138,7 +137,7 @@ export default async function babelSwcLoader(
138137
139138 const swcResult = swc . transformSync ( babelResult ?. code ! , {
140139 ...finalSwcConfig ,
141- caller : { name : loaderName } ,
140+ caller : { name : '@callstack/repack' } ,
142141 filename : this . resourcePath ,
143142 configFile : false ,
144143 swcrc : false ,
Original file line number Diff line number Diff line change @@ -17,7 +17,11 @@ export function isTSXSource(fileName: string) {
1717}
1818
1919export function getProjectBabelConfig ( filename : string , projectRoot ?: string ) {
20- const babelConfig = loadOptions ( { filename, root : projectRoot } ) ;
20+ const babelConfig = loadOptions ( {
21+ caller : { name : '@callstack/repack' } ,
22+ filename,
23+ root : projectRoot ,
24+ } ) ;
2125 return babelConfig ?? { } ;
2226}
2327
You can’t perform that action at this time.
0 commit comments