2021-07-16 13:00:21 +08:00
|
|
|
import { viteMockServe } from 'vite-plugin-mock';
|
|
|
|
import { UserConfigExport, ConfigEnv } from 'vite';
|
|
|
|
|
2021-07-16 14:44:18 +08:00
|
|
|
export default (conifg: ConfigEnv): UserConfigExport => {
|
2021-07-16 13:00:21 +08:00
|
|
|
return {
|
|
|
|
plugins: [
|
|
|
|
viteMockServe({
|
|
|
|
mockPath: 'mock',
|
2021-07-16 14:44:18 +08:00
|
|
|
localEnabled: conifg.command == "serve",
|
2021-07-16 13:00:21 +08:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
esbuild: {
|
|
|
|
jsxFactory: 'h',
|
2021-08-07 11:04:43 +08:00
|
|
|
jsxFragment: 'h.f'
|
2021-07-16 13:00:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|