Skip to content

Commit

Permalink
Use config.loadConfig to load config
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Feb 21, 2022
1 parent 165c5e8 commit b8330fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/transformers/svg-react/src/SvgReactTransformer.js
Expand Up @@ -17,13 +17,18 @@ function getComponentName(filePath) {
}

export default (new Transformer({
async transform({asset}) {
async loadConfig({config}) {
let { contents } = await config.getConfig(['.svgrrc', '.svgrrc.json']);
return contents;
},

async transform({asset,config}) {
let code = await asset.getCode();
let componentName = getComponentName(asset.filePath);

const jsx = await transform(
code,
{},
{ ...config, runtimeConfig: false },
{
caller: {
name: '@parcel/transformer-svg-react',
Expand Down

0 comments on commit b8330fa

Please sign in to comment.