赞
踩
创建vite项目 (vite + vue3 + vue-router + element-plus + pinia)
先查看node和npm的版本号,最好装个16版本以上的node
npm init vite@latest
#查看当前源
npm config get registry
#更换为国内镜像
npm config set registry=http://registry.npm.taobao.org/
npm install
import {
defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as path from "path";
const pathSrc = path.resolve(__dirname, "src");
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
base: "/", //不加打包后白屏
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。