45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import { TDesignResolver } from 'unplugin-vue-components/resolvers';
|
|
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
uni(),
|
|
AutoImport({
|
|
resolvers: [TDesignResolver({
|
|
library: 'mobile-vue'
|
|
})],
|
|
}),
|
|
Components({
|
|
resolvers: [TDesignResolver({
|
|
library: 'mobile-vue'
|
|
})],
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src')
|
|
}
|
|
},
|
|
server: {
|
|
/* https: {
|
|
cert: fs.readFileSync(path.join(__dirname, 'src/ssl/localhost+2.pem')),
|
|
key: fs.readFileSync(path.join(__dirname, 'src/ssl/localhost+2-key.pem'))
|
|
},*/
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://119.91.224.39:9090/',
|
|
// target: 'http://192.168.118.1:9090/',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
}
|
|
})
|