Allow multiple Vite to run simultaneously
npm install vite-plugin-multipleAllow multiple Vite to run simultaneously.


``sh`
npm i -D vite-plugin-multiple
`js
import multiple from 'vite-plugin-multiple'
export default {
plugins: [
multiple([
{
name: 'foo',
config: 'vite.foo.config.mjs',
},
{
name: 'bar',
config: 'vite.bar.config.mjs',
},
]),
],
}
`
vite serve
- http://localhost:5173 access to the main apphttp://localhost:5174
- access to the foo apphttp://localhost:5175
- access to the bar app
vite build
- dist main appdist/foo
- foo appdist/bar
- bar app
`ts``
multiple(
apps: {
/**
* Human friendly name of your entry point.
*/
name: string
/**
* Vite config file path.
*/
config: string
/**
* Explicitly specify the run command.
*/
command?: 'build' | 'serve'
}[],
options: {
/**
* Called when all builds are complete.
*/
callback?: () => void,
} = {},
)