Error: Dynamic require of "path" is not supported

failed to load config from D:\BaiduSyncdisk\vue3\sys-manager\vite.config.js
error when starting dev server:
Error: Dynamic require of "path" is not supported

 

 

原因在于vite中没有不支持require()

const path = require('path') 

改成
import path from 'path'

posted @ 2023-06-25 14:14  侬侬发  阅读(496)  评论(0)    收藏  举报