From d336fe289bc6d66fe71b24d9703239c44404c800 Mon Sep 17 00:00:00 2001 From: vwxyutarooo Date: Fri, 27 Jul 2018 16:46:30 +0900 Subject: [PATCH 1/2] chore(rollup): set name property to better error and waring messages --- packages/rollup/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rollup/src/index.js b/packages/rollup/src/index.js index f8b79355..da9ff196 100644 --- a/packages/rollup/src/index.js +++ b/packages/rollup/src/index.js @@ -8,6 +8,7 @@ function svgrPlugin(options = {}) { const { babel = true } = options return { + name: 'svgr', async transform(data, id) { if (!filter(id)) return null if (id.slice(-4) !== '.svg') return null From 5fb1c179278543b7b2d23a9081a18cb722bd6af9 Mon Sep 17 00:00:00 2001 From: vwxyutarooo Date: Fri, 27 Jul 2018 17:09:09 +0900 Subject: [PATCH 2/2] fix(rollup): support rollup-plugin-typescript2 #127 --- packages/rollup/src/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/rollup/src/index.js b/packages/rollup/src/index.js index da9ff196..93d7c44c 100644 --- a/packages/rollup/src/index.js +++ b/packages/rollup/src/index.js @@ -55,9 +55,13 @@ function svgrPlugin(options = {}) { ) }) - const code = babel ? await pBabelTransform(jsCode) : jsCode + if (babel) { + const code = await pBabelTransform(jsCode); - return { ast, code, map: { mappings: '' } } + return { code, map: { mappings: '' } } + } + + return { ast, code: jsCode, map: { mappings: '' } } }, } }