12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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'
- import AutoImport from 'unplugin-auto-import/vite'
- import Components from 'unplugin-vue-components/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- const path = require('path')
- function resolve(dir: string) {
- return path.join(__dirname, dir)
- }
- // https://vitejs.dev/config/
- // https://github.com/vitejs/vite/issues/1930 .env
- // const proxyUrl = 'https://www.colexiu.com/';
- const proxyUrl = 'https://dev.colexiu.com/'
- export default defineConfig({
- base: './',
- plugins: [
- vue(),
- vueJsx(),
- legacy({
- targets: ['> 0.25%, not dead'],
- ignoreBrowserslistConfig: true
- }),
- AutoImport({
- resolvers: [ElementPlusResolver()]
- }),
- Components({
- resolvers: [ElementPlusResolver()]
- })
- ],
- css: {
- preprocessorOptions: {
- scss: {
- charset: false
- }
- }
- },
- 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: 5500,
- strictPort: true,
- proxy: {
- '/api-auth': {
- target: proxyUrl,
- changeOrigin: true
- },
- '/api-website': {
- target: proxyUrl,
- changeOrigin: true
- }
- }
- },
- build: {
- rollupOptions: {
- input: {
- index: resolve('index.html')
- }
- }
- }
- })
|