https://github.com/lishaobos/svg-preview-plugin/blob/c0bda8e8e42fc288b8c06f41cf568db4dece5446/utils/index.ts#L1C1-L3C72
vite下运行__dirname 会报错,需要改成下面这样:
import path from "path";
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(new URL(import.meta.url));
const __dirname = path.dirname(__filename);
https://github.com/lishaobos/svg-preview-plugin/blob/c0bda8e8e42fc288b8c06f41cf568db4dece5446/utils/index.ts#L1C1-L3C72
vite下运行__dirname 会报错,需要改成下面这样: