mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-04 04:57:53 +08:00
15 lines
381 B
TypeScript
15 lines
381 B
TypeScript
import fs from 'node:fs'
|
|
import ViteRestart from 'vite-plugin-restart'
|
|
|
|
export default function createRestart() {
|
|
const pluginsFile: string[] = []
|
|
fs.readdirSync('vite/plugins').forEach((dirname) => {
|
|
if (fs.statSync(`vite/plugins/${dirname}`).isFile()) {
|
|
pluginsFile.push(`vite/plugins/${dirname}`)
|
|
}
|
|
})
|
|
return ViteRestart({
|
|
restart: pluginsFile,
|
|
})
|
|
}
|