fix(js): typescript plugin target hashing (#23073)
This commit is contained in:
parent
3cf13ab864
commit
addde70251
@ -104,18 +104,20 @@ export const createNodes: CreateNodes<TscPluginOptions> = [
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const hash = calculateHashForCreateNodes(
|
const nodeHash = calculateHashForCreateNodes(
|
||||||
projectRoot,
|
projectRoot,
|
||||||
pluginOptions,
|
pluginOptions,
|
||||||
context,
|
context,
|
||||||
[getLockFileName(detectPackageManager(context.workspaceRoot))]
|
[getLockFileName(detectPackageManager(context.workspaceRoot))]
|
||||||
);
|
);
|
||||||
|
// The hash is calculated at the node/project level, so we add the config file path to avoid conflicts when caching
|
||||||
|
const cacheKey = `${nodeHash}_${configFilePath}`;
|
||||||
|
|
||||||
const targets = targetsCache[hash]
|
const targets = targetsCache[cacheKey]
|
||||||
? targetsCache[hash]
|
? targetsCache[cacheKey]
|
||||||
: buildTscTargets(fullConfigPath, projectRoot, pluginOptions, context);
|
: buildTscTargets(fullConfigPath, projectRoot, pluginOptions, context);
|
||||||
|
|
||||||
calculatedTargets[hash] = targets;
|
calculatedTargets[cacheKey] = targets;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
projects: {
|
projects: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user