We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7ab92b commit 4b3737eCopy full SHA for 4b3737e
1 file changed
packages/rollup/src/index.js
@@ -8,6 +8,7 @@ function svgrPlugin(options = {}) {
8
const { babel = true } = options
9
10
return {
11
+ name: 'svgr',
12
async transform(data, id) {
13
if (!filter(id)) return null
14
if (id.slice(-4) !== '.svg') return null
@@ -54,9 +55,13 @@ function svgrPlugin(options = {}) {
54
55
)
56
})
57
- const code = babel ? await pBabelTransform(jsCode) : jsCode
58
+ if (babel) {
59
+ const code = await pBabelTransform(jsCode);
60
- return { ast, code, map: { mappings: '' } }
61
+ return { code, map: { mappings: '' } }
62
+ }
63
+
64
+ return { ast, code: jsCode, map: { mappings: '' } }
65
},
66
}
67
0 commit comments