mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 21:47:55 +08:00
优化vite自动重启插件配置
This commit is contained in:
parent
77baee03db
commit
019fd3dc03
@ -1,21 +1,17 @@
|
||||
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: [
|
||||
'.env.development',
|
||||
'vite/plugins/index.js',
|
||||
'vite/plugins/auto-import.js',
|
||||
'vite/plugins/banner.js',
|
||||
'vite/plugins/components.js',
|
||||
'vite/plugins/compression.js',
|
||||
'vite/plugins/html.js',
|
||||
'vite/plugins/jsx.js',
|
||||
'vite/plugins/mock.js',
|
||||
'vite/plugins/restart.js',
|
||||
'vite/plugins/setup-extend.js',
|
||||
'vite/plugins/spritesmith.js',
|
||||
'vite/plugins/svg-icon.js'
|
||||
...pluginsFile,
|
||||
'.env.development'
|
||||
]
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user