vite.config.js 配置参数

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    open:true,     //设置为自动打开网页
  },
  resolve: {
    alias: [
      {find: '@', replacement: resolve(__dirname, 'src')},
      { find: /^~/, replacement: '' }
    ]
  },
  define: {
    'process.env': {
      VUE_APP_BASE_API:'http://127.0.0.1:9999'
    }
  }
})


你可能感兴趣的:(vue.js)