diff --git a/rollup.config.mjs b/rollup.config.mjs index 638cc6f56..fee0f19b8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -174,7 +174,7 @@ function createConfig(format, _output, plugins = []) { declaration: shouldEmitDeclarations, declarationMap: shouldEmitDeclarations }, - exclude: ['**/test', 'test-dts', 'e2e', 'scripts'] + exclude: ['**/test', 'test-dts', 'e2e', 'scripts', '*.config.ts'] } }) // we only need to check TS and generate declarations once for each build. diff --git a/scripts/postprocess.ts b/scripts/postprocess.ts index 132a4044d..97fd28c30 100644 --- a/scripts/postprocess.ts +++ b/scripts/postprocess.ts @@ -8,7 +8,7 @@ function replaceWithCompositionApi(source: string, target: string) { ) } -async function main() { +async function replaceVueI18nBridge() { let source = await fs.readFile( path.resolve( __dirname, @@ -37,6 +37,39 @@ async function main() { ) } +const RE_TRIPLE_SLASH_REFERENCE = /\/\/\/ / + +function replaceTripleSlashReference(source: string) { + return source + .replace(RE_TRIPLE_SLASH_REFERENCE, ``) + .replace(RE_TRIPLE_SLASH_REFERENCE, '') +} + +async function replaceMessageCompiler() { + let source = await fs.readFile( + path.resolve( + __dirname, + '../packages/message-compiler/dist/message-compiler.d.ts' + ), + 'utf8' + ) + + source = replaceTripleSlashReference(source) + + await fs.writeFile( + path.resolve( + __dirname, + '../packages/message-compiler/dist/message-compiler.d.ts' + ), + source + ) +} + +async function main() { + await replaceVueI18nBridge() + await replaceMessageCompiler() +} + main().catch(err => { console.error(err) process.exit(1)