Preview the svg file.
npm add svg-to-component-preview
- Return the module path, and the temporary storage directory of the React component saved
import { packagePath, componentsPath } from 'svg-to-component-preview';
console.log(packagePath, componentsPath);
// Start preview
spawn(`pnpm`, ['run', 'start'], {
cwd: previewPackagePath,
stdio: 'inherit',
});