Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
35 changes: 34 additions & 1 deletion scripts/postprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function replaceWithCompositionApi(source: string, target: string) {
)
}

async function main() {
async function replaceVueI18nBridge() {
let source = await fs.readFile(
path.resolve(
__dirname,
Expand Down Expand Up @@ -37,6 +37,39 @@ async function main() {
)
}

const RE_TRIPLE_SLASH_REFERENCE = /\/\/\/ <reference types="([^"]*)" \/>/

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)
Expand Down