update comment

This commit is contained in:
tai-cha 2025-02-17 19:55:04 +09:00
parent f45bf08dd4
commit 798439dfaa
No known key found for this signature in database
GPG Key ID: 1D5EE39F870DC283
1 changed files with 4 additions and 4 deletions

View File

@ -202,7 +202,7 @@ async function processVueFile(
) { ) {
const s = new MagicString(code); // magic-string のインスタンスを作成 const s = new MagicString(code); // magic-string のインスタンスを作成
const ast = vueSfcParse(code, { filename: id }).descriptor.template?.ast; // テンプレート AST を取得 const ast = vueSfcParse(code, { filename: id }).descriptor.template?.ast; // テンプレート AST を取得
const markerRelations: MarkerRelation[] = []; // MarkerRelation 配列を初期化 const markerRelations: MarkerRelation[] = []; // MarkerRelation 配列を初期化
if (ast) { if (ast) {
function traverse(node: any, currentParent?: any) { function traverse(node: any, currentParent?: any) {
@ -286,8 +286,8 @@ async function processVueFile(
} }
const transformedCode = s.toString(); // 変換後のコードを取得 const transformedCode = s.toString(); // 変換後のコードを取得
transformedCodeCache[id] = transformedCode; // 変換後のコードをキャッシュに保存 transformedCodeCache[id] = transformedCode; // 変換後のコードをキャッシュに保存
return { return {
code: transformedCode, // 変更後のコードを返す code: transformedCode, // 変更後のコードを返す
@ -301,7 +301,7 @@ export default function pluginCreateSearchIndex(options: {
targetFilePaths: string[], targetFilePaths: string[],
exportFilePath: string exportFilePath: string
}): Plugin { }): Plugin {
let transformedCodeCache: Record<string, string> = {}; // キャッシュオブジェクトをプラグインスコープで定義 let transformedCodeCache: Record<string, string> = {}; // キャッシュオブジェクトをプラグインスコープで定義
const isDevServer = process.env.NODE_ENV === 'development'; // 開発サーバーかどうか const isDevServer = process.env.NODE_ENV === 'development'; // 開発サーバーかどうか
return { return {