运行svg预览器。
npm add svg-to-component-preview
- 返回模块路径,和预览svg组件的临时存储目录
import { packagePath, componentsPath } from 'svg-to-component-preview';
console.log(packagePath, componentsPath);
// 启动预览
spawn(`pnpm`, ['run', 'start'], {
cwd: previewPackagePath,
stdio: 'inherit',
});