Vite HMR API build
类型校验:
async function build(
inlineConfig?: InlineConfig
): Promise<RollupOutput | RollupOutput[]>
使用示例:
const path = require('path')
const { build } = require('vite')
;(async () => {
await build({
root: path.resolve(__dirname, './project'),
base: '/foo/',
build: {
rollupOptions: {
// ...
}
}
})
})()