build: clear ts plugin cache before building for release

ref: #1591
This commit is contained in:
Evan You 2020-07-15 10:47:57 -04:00
parent 32a4cb804b
commit 81e82e7d21

View File

@ -36,6 +36,10 @@ const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
run() run()
async function run() { async function run() {
if (isRelease) {
// remove build cache for release builds to avoid outdated enum values
await fs.remove(path.resolve(__dirname, '../node_modules/.rts2_cache'))
}
if (!targets.length) { if (!targets.length) {
await buildAll(allTargets) await buildAll(allTargets)
checkAllSizes(allTargets) checkAllSizes(allTargets)