From 722e03a56979e7c75d4f02ebc03687f0134d1d1d Mon Sep 17 00:00:00 2001 From: "li.li" Date: Tue, 1 Jan 2019 13:52:21 +0800 Subject: [PATCH] fix: set default pragmaFrag option :bug: fix #2305 --- .../core/parcel-bundler/src/transforms/babel/jsx.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/parcel-bundler/src/transforms/babel/jsx.js b/packages/core/parcel-bundler/src/transforms/babel/jsx.js index 48e37d1c45e..67bfc1dcf0c 100644 --- a/packages/core/parcel-bundler/src/transforms/babel/jsx.js +++ b/packages/core/parcel-bundler/src/transforms/babel/jsx.js @@ -74,7 +74,15 @@ async function getJSXConfig(asset, isSourceModule) { internal: true, babelVersion: 7, config: { - plugins: [[require('@babel/plugin-transform-react-jsx'), {pragma}]] + plugins: [ + [ + require('@babel/plugin-transform-react-jsx'), + { + pragma, + pragmaFrag: 'React.Fragment' + } + ] + ] } }; }