2021-09-01 11:26:19 +08:00
|
|
|
import { defineConfig } from 'vite';
|
2021-10-18 17:04:47 +08:00
|
|
|
import { viteMockServe } from 'vite-plugin-mock';
|
|
|
|
import createVuePlugin from '@vitejs/plugin-vue';
|
2021-08-26 11:25:15 +08:00
|
|
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
2021-11-19 15:25:24 +08:00
|
|
|
import svgLoader from 'vite-svg-loader';
|
2021-08-26 11:25:15 +08:00
|
|
|
|
2021-10-18 17:04:47 +08:00
|
|
|
import path from 'path';
|
2021-08-26 11:25:15 +08:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2021-12-13 11:44:18 +08:00
|
|
|
base: './',
|
2021-08-26 11:25:15 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
},
|
|
|
|
},
|
2021-10-18 17:04:47 +08:00
|
|
|
|
2021-08-26 11:25:15 +08:00
|
|
|
plugins: [
|
2021-10-18 17:04:47 +08:00
|
|
|
createVuePlugin(),
|
2021-09-01 11:26:19 +08:00
|
|
|
vueJsx(),
|
2021-10-18 17:04:47 +08:00
|
|
|
viteMockServe({
|
|
|
|
mockPath: 'mock',
|
|
|
|
localEnabled: true,
|
|
|
|
}),
|
2021-11-16 19:01:03 +08:00
|
|
|
svgLoader(),
|
2021-08-26 11:25:15 +08:00
|
|
|
],
|
2021-10-18 17:04:47 +08:00
|
|
|
|
2021-08-26 11:25:15 +08:00
|
|
|
server: {
|
|
|
|
port: 3002,
|
2021-12-15 21:09:28 +08:00
|
|
|
host: '0.0.0.0',
|
2021-12-12 15:46:02 +08:00
|
|
|
proxy: {
|
|
|
|
'/api': 'http://127.0.0.1:3000/',
|
|
|
|
},
|
2021-08-26 11:25:15 +08:00
|
|
|
},
|
2021-09-01 11:26:19 +08:00
|
|
|
});
|