Anomen / next-svgr

Convert your SVG files into React components in Next
MIT License
26 stars 9 forks source link

Resolve @svgr/webpack relative to next-svgr #2

Open elliottsj opened 4 years ago

elliottsj commented 4 years ago

Previously, webpack would attempt to resolve @svgr/webpack relative to the Next.js project, which would result in an error like this using strict package managers like pnpm / Yarn PnP:

Module not found: Can't resolve '@svgr/webpack' in '/path/to/project'

Using require.resolve() fixes this.