diff --git a/packages/unplugin-typia/src/core/cache.ts b/packages/unplugin-typia/src/core/cache.ts index 7e11f1e3..b65c4d45 100644 --- a/packages/unplugin-typia/src/core/cache.ts +++ b/packages/unplugin-typia/src/core/cache.ts @@ -100,7 +100,7 @@ export class Cache { } private get hashComment() { - return `/* unplugin-typia-${typiaVersion ?? ''}-${this.#hashKey} */`; + return `/* unplugin-typia-${typiaVersion ?? ''}-${this.#hashKey} */\n`; } private isWritable(filename: string): boolean { diff --git a/packages/unplugin-typia/tests/cache.spec.ts b/packages/unplugin-typia/tests/cache.spec.ts index 977b6ee9..3c7657f2 100644 --- a/packages/unplugin-typia/tests/cache.spec.ts +++ b/packages/unplugin-typia/tests/cache.spec.ts @@ -14,7 +14,7 @@ function removeComments(data: string | undefined) { } // eslint-disable-next-line regexp/no-unused-capturing-group - return data.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, ''); + return data.replace(/\/\*[\s\S]*?\*\/\n?|([^\\:]|^)\/\/.*$/gm, ''); } it('return null if cache is not found', async () => {