You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
758 B
TypeScript
30 lines
758 B
TypeScript
4 months ago
|
// good
|
||
|
import vue from '@vitejs/plugin-vue';
|
||
|
import { resolve } from 'path';
|
||
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
||
|
|
||
|
import { REQUEST_BASE_URL } from './src/constant/request';
|
||
|
|
||
|
import type { UserConfigExport } from 'vite';
|
||
|
|
||
|
export default () => {
|
||
|
const target = 'http://fjtb.bj-eib.com/api';
|
||
|
const baseConfig: UserConfigExport = {
|
||
|
server: {
|
||
|
port: 80,
|
||
|
open: true,
|
||
|
proxy: {
|
||
|
[REQUEST_BASE_URL]: {
|
||
|
target,
|
||
|
changeOrigin: true,
|
||
|
rewrite: path => path.replace(REQUEST_BASE_URL, ''),
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
resolve: { alias: { '@': resolve(process.cwd(), './src') } },
|
||
|
plugins: [vue(), createHtmlPlugin({ entry: '/src/main.ts', minify: true })],
|
||
|
};
|
||
|
|
||
|
return baseConfig;
|
||
|
};
|