Clear and concise description of the problem
My vite config has two inputs sources configured:
input: {
site: 'src/ts/index.ts',
admin: 'src/ts/cp.ts',
},
the files that impact the compiled output of index.ts are under /templates and the files that impact the output of cp.ts are under /config. So I have:
viteRestart({
reload: ['templates/**/*', 'config/**/*'],
})
I would love the ability to allow these restarts to affect only certain pages on the front end. Specifically, changes to config cause a reload of everything under /admin, and changes to templates cause a reload of everything else.
Suggested solution
One suggestion for the configuration would be to allow the reload configuration to take an array of objects:
viteRestart({
reload: [{
src: 'templates/**/*',
pages: '^[^(admin)].*' // reload pages not starting with 'admin'
}, {
src: 'config/**/*'],
pages: '^(admin).*' // reload pages starting with 'admin'
}
})
Alternative
No response
Additional context
No response
Validations
Clear and concise description of the problem
My vite config has two inputs sources configured:
the files that impact the compiled output of
index.tsare under/templatesand the files that impact the output ofcp.tsare under/config. So I have:I would love the ability to allow these restarts to affect only certain pages on the front end. Specifically, changes to
configcause a reload of everything under/admin, and changes totemplatescause a reload of everything else.Suggested solution
One suggestion for the configuration would be to allow the reload configuration to take an array of objects:
Alternative
No response
Additional context
No response
Validations