constpackageMarker=`${packageJsonMarkerId}:"${packageJsonMarkerId}"`;// this needs to be the format after esbuild has processed the file (e.g. double quotes)
if(content.includes(packageMarker)){
content=content.replace(packageMarker,JSON.stringify(JSON.parse(ctx.packageJsonFn())).slice(1,-1)/* trim braces */);
markerFound=true;
}
// const productMarker = `${productJsonMarkerId}:"${productJsonMarkerId}"`; // this needs to be the format after esbuild has processed the file (e.g. double quotes)
// if (content.includes(productMarker)) {
// content = content.replace(productMarker, JSON.stringify(JSON.parse(ctx.productJsonFn())).slice(1, -1) /* trim braces */);
// markerFound = true;
// }
if(markerFound){
file.contents=Buffer.from(content);
}
}
this.emit('data',file);
}));
}
functionmatchesFile(file,ctx){
for(consttargetPathofctx.targetPaths){
if(file.basename===(0,path_1.basename)(targetPath)){// TODO would be nicer to figure out root relative path to not match on false positives