import { defineConfig } from '@umijs/max';
import path from 'path';
//@ts-ignore
export default defineConfig({
	proxy: {
		'/api': {
			target: 'http://api.erp.xunhong168.test/',
			changeOrigin: true,
			pathRewrite: { '^/api': '' },
		},
	},
	plugins: ['@umijs/max-plugin-openapi'],
	openAPI: [
		{
			requestLibPath: "import request from '../request';",
			// schemaPath: 'http://localhost:8082/v3/api-docs',
			schemaPath: path.resolve(__dirname, '../../swagger/auth.json'),
			projectName: 'auth',
			namespace: 'AuthAPI',
		},
	],
});
