Closed miaolq closed 2 years ago
It was difficult for me going through the Webpack documentation to try and find a type signature for require.context()
; however, not a single test prefixes any string with a '!'
.
I'm a little worried that perhaps this isn't desired behavior, since it's not a loader.
Thank you. For now, i will code like this.
const res = IS_TEST
? requireContext('../../../assets/svgs', false, /\.(svg)$/)
: require.context('!@svgr/webpack!assets/svgs', false, /\.(svg)$/);
Describe the bug
requireContext('!@svgr/webpack!../../../assets/svgs', false, /\.(svg)$/)
will treat!@svgr/webpack!
as path instead of webpack loader options.Expected behavior
Treat
!@svgr/webpack!
as webpack loader optionsEnvironment