Closed cescoferraro closed 7 years ago
@cescoferraro
Two suggestions:
.babelrc
file to set your presets and other information for babel
, then your test looks like this: { test: /\.svg$/, loader: 'babel!svg-react' }
. In addition, with a .babelrc
file in your project's root directory all uses of babel
will use it (thinking of tests).svg-react-loader@next
it no longer depends on babel
Great LIbrary, congrats!
This works
let Image1 = require("-!babel-loader!svg-react-loader!./kiwi.svg");
readme suggests doing{ test: /\.svg$/, loader: 'babel-loader?presets[]=es2015,presets[]=react!svg-react-loader' },
but then I get this errorModule build failed: Error: Non-whitespace before first tag.
which is the same as if I try ( without disabling configured preLoaders and loaders but not the postLoaders)let Image1 = require("babel-loader!svg-react-loader!./kiwi.svg");
How can I keep this thing inside my webpck.config.js to avoid having my team to type all that when they want to add a svg.