123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import { defineConfig } from 'vite';
- import vue from '@vitejs/plugin-vue';
- import styleImport from 'vite-plugin-style-import';
- import vueJsx from '@vitejs/plugin-vue-jsx';
- import legacy from '@vitejs/plugin-legacy';
- const path = require('path');
- function resolve(dir: string) {
- return path.join(__dirname, dir);
- }
- const proxyUrl = 'http://dev.colexiu.com/';
- export default defineConfig({
- base: './',
- plugins: [
- vue(),
- vueJsx(),
- legacy({
- targets: ['> 0.25%, not dead'],
- ignoreBrowserslistConfig: true
- }),
- styleImport({
- libs: [
- {
- libraryName: 'vant',
- esModule: true,
- resolveStyle: name => `vant/es/${name}/style`
- }
- ]
- })
- ],
- resolve: {
- alias: {
- '@': resolve('./src'),
- '@common': resolve('./src/common'),
- '@components': resolve('./src/components'),
- '@store': resolve('./src/store'),
- '@views': resolve('./src/views')
- }
- },
- server: {
- host: '0.0.0.0',
- port: 5000,
- strictPort: true,
- proxy: {
- '/api-auth': {
- target: proxyUrl,
- changeOrigin: true
- },
- '/api-student': {
- target: proxyUrl,
- changeOrigin: true
- },
- '/api-teacher': {
- target: proxyUrl,
- changeOrigin: true
- },
- '/api-web': {
- target: proxyUrl,
- changeOrigin: true
- }
- }
- },
- build: {
- rollupOptions: {
- input: {
- index: path.resolve(__dirname, 'index.html'),
- about: path.resolve(__dirname, 'teacher.html')
- }
- }
- }
- });
|