mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: include transpilation mode in the compute cache hash (#11521)
This commit is contained in:
parent
5a15d2cd4d
commit
50fa839e64
@ -239,7 +239,8 @@ export class Runner {
|
||||
}
|
||||
|
||||
// 4. Filter only
|
||||
filterOnly(preprocessRoot);
|
||||
if (!list)
|
||||
filterOnly(preprocessRoot);
|
||||
|
||||
// 5. Complain about clashing.
|
||||
const clashingTests = getClashingTestsPerSuite(preprocessRoot);
|
||||
|
||||
@ -48,7 +48,7 @@ sourceMapSupport.install({
|
||||
});
|
||||
|
||||
function calculateCachePath(content: string, filePath: string): string {
|
||||
const hash = crypto.createHash('sha1').update(content).update(filePath).update(String(version)).digest('hex');
|
||||
const hash = crypto.createHash('sha1').update(process.env.PW_EXPERIMENTAL_TS_ESM ? 'esm' : 'no_esm').update(content).update(filePath).update(String(version)).digest('hex');
|
||||
const fileName = path.basename(filePath, path.extname(filePath)).replace(/\W/g, '') + '_' + hash;
|
||||
return path.join(cacheDir, hash[0] + hash[1], fileName);
|
||||
}
|
||||
@ -60,7 +60,7 @@ export function transformHook(code: string, filename: string, tsconfig: TsConfig
|
||||
const codePath = cachePath + '.js';
|
||||
const sourceMapPath = cachePath + '.map';
|
||||
sourceMaps.set(filename, sourceMapPath);
|
||||
if (fs.existsSync(codePath))
|
||||
if (!process.env.PW_IGNORE_COMPILE_CACHE && fs.existsSync(codePath))
|
||||
return fs.readFileSync(codePath, 'utf8');
|
||||
// We don't use any browserslist data, but babel checks it anyway.
|
||||
// Silence the annoying warning.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user