You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the file contains content that depends on the Release Registry (such as an SDK's latest version), avoid using the cache for that file, i.e. always rebuild it.
535
+
// This is because the content from the registry might have changed since the last time the file was cached.
536
+
// If a new component that injects content from the registry is introduced, it should be added to the patterns below.
537
+
constskipCache=
538
+
source.includes('@inject')||
539
+
source.includes('<PlatformSDKPackageName')||
540
+
source.includes('<LambdaLayerDetail');
541
+
534
542
if(process.env.CI){
535
-
cacheKey=md5(source);
536
-
cacheFile=path.join(CACHE_DIR,`${cacheKey}.br`);
537
-
assetsCacheDir=path.join(CACHE_DIR,cacheKey);
543
+
if(skipCache){
544
+
// eslint-disable-next-line no-console
545
+
console.info(
546
+
`Not using cached version of ${sourcePath}, as its content depends on the Release Registry`
547
+
);
548
+
}else{
549
+
cacheKey=md5(source);
550
+
cacheFile=path.join(CACHE_DIR,`${cacheKey}.br`);
551
+
assetsCacheDir=path.join(CACHE_DIR,cacheKey);
538
552
539
-
try{
540
-
const[cached,_]=awaitPromise.all([
541
-
readCacheFile<SlugFile>(cacheFile),
542
-
cp(assetsCacheDir,outdir,{recursive: true}),
543
-
]);
544
-
returncached;
545
-
}catch(err){
546
-
if(
547
-
err.code!=='ENOENT'&&
548
-
err.code!=='ABORT_ERR'&&
549
-
err.code!=='Z_BUF_ERROR'
550
-
){
551
-
// If cache is corrupted, ignore and proceed
552
-
// eslint-disable-next-line no-console
553
-
console.warn(`Failed to read MDX cache: ${cacheFile}`,err);
553
+
try{
554
+
const[cached,_]=awaitPromise.all([
555
+
readCacheFile<SlugFile>(cacheFile),
556
+
cp(assetsCacheDir,outdir,{recursive: true}),
557
+
]);
558
+
returncached;
559
+
}catch(err){
560
+
if(
561
+
err.code!=='ENOENT'&&
562
+
err.code!=='ABORT_ERR'&&
563
+
err.code!=='Z_BUF_ERROR'
564
+
){
565
+
// If cache is corrupted, ignore and proceed
566
+
// eslint-disable-next-line no-console
567
+
console.warn(`Failed to read MDX cache: ${cacheFile}`,err);
0 commit comments