omi/packages/admin/vite.config.ts

29 lines
522 B
TypeScript
Raw Permalink Normal View History

2021-08-24 01:58:40 +08:00
import path from 'path'
import { viteMockServe } from 'vite-plugin-mock'
import { defineConfig } from 'vite'
2021-08-24 01:58:40 +08:00
export default defineConfig(({ command }) => {
return {
2021-08-24 01:58:40 +08:00
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`
}
},
plugins: [
viteMockServe({
mockPath: 'mock',
2021-08-24 01:58:40 +08:00
localEnabled: command == 'serve'
2021-08-31 10:54:16 +08:00
})
],
esbuild: {
jsxFactory: 'h',
2021-08-07 11:04:43 +08:00
jsxFragment: 'h.f'
2021-08-24 01:58:40 +08:00
},
server: {
fs: {
strict: true
}
}
}
2021-08-24 01:58:40 +08:00
})