mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 13:37:45 +08:00
15 lines
396 B
JavaScript
15 lines
396 B
JavaScript
import ViteRestart from 'vite-plugin-restart'
|
|
|
|
export default function createRestart() {
|
|
const pluginsFile = []
|
|
const fs = require('fs')
|
|
fs.readdirSync('vite/plugins').map(dirname => {
|
|
if (fs.statSync(`vite/plugins/${dirname}`).isFile()) {
|
|
pluginsFile.push(`vite/plugins/${dirname}`)
|
|
}
|
|
})
|
|
return ViteRestart({
|
|
restart: pluginsFile
|
|
})
|
|
}
|