我们需要在 vite.config.js 中进行添加下方代码。import { defineConfig } from 'vite';

我们需要在 vite.config.js 中进行添加下方代码。

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
const path = require('path');

export default defineConfig({
  plugins: [vue()],
  define: {
    'process.env': {},
  },
  resolve: {
    // 配置路径别名
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
});

更新指南

本文由青舟模板网发布,如若转载,请注明出处:http://qingzo.com/jishu/20220622160609.html