hashの生成を正規化(絶対パスになっていたのを緩和)

This commit is contained in:
tai-cha
2025-03-03 00:20:30 +09:00
parent 54ab3ef139
commit 4da4350dde
2 changed files with 94 additions and 92 deletions

View File

@@ -1109,7 +1109,9 @@ async function processVueFile(
// 行番号はコード先頭からの改行数で取得
const lineNumber = code.slice(0, node.loc.start.offset).split('\n').length;
// ファイルパスと行番号からハッシュ値を生成
const generatedMarkerId = toBase62(hash(`${id}:${lineNumber}`));
// この際実行環境で差が出ないようにファイルパスを正規化
const idKey = id.split('packages/frontend/')[1]
const generatedMarkerId = toBase62(hash(`${idKey}:${lineNumber}`));
const props = node.props || [];
const hasMarkerIdProp = props.some((prop: any) => prop.type === 6 && prop.name === 'markerId');