Files
WeFlow/scripts/clean-dist-electron.cjs
2026-09-28 21:16:43 +08:00

11 lines
409 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 构建前清空 dist-electron:vite 产物带内容 hash(如 config-XXXX.js),
// 不清理会让旧版本 chunk 无限堆积并被误打进安装包
const { rmSync, existsSync } = require('fs')
const { join } = require('path')
const dir = join(__dirname, '..', 'dist-electron')
if (existsSync(dir)) {
rmSync(dir, { recursive: true, force: true })
console.log('[clean] dist-electron removed')
}