From 3290d4713d41e97155fe33741dfa8a858f7a7188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=A1=E6=95=B0?= Date: Mon, 23 Aug 2021 18:15:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20site=20=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 16 ++++++++++++---- package.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/babel.config.js b/babel.config.js index 22e7ca2b07..151c04285f 100644 --- a/babel.config.js +++ b/babel.config.js @@ -6,13 +6,21 @@ module.exports = api => { const isCommonJS = api.env('cjs'); const isESModule = api.env('esm'); const isTest = api.env('test'); - + if (isSite) { + console.log('-------------->') return { presets: [ - 'babel-preset-gatsby', { - silence: true - } + '@babel/preset-env', + // 'babel-preset-gatsby', { + // silence: true + // }, + [ + '@babel/preset-react', + { + development: isCommonJS + } + ] ], plugins: [ '@babel/plugin-proposal-optional-chaining', diff --git a/package.json b/package.json index a76bbb0903..85740cf5ac 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "babel-plugin-transform-inline-environment-variables": "^0.4.3", "babel-plugin-transform-node-env-inline": "^0.4.3", "babel-plugin-transform-postcss": "^0.3.0", - "babel-preset-gatsby": "^0.5.8", + "babel-preset-gatsby": "^1.12.0", "babel-template": "^6.26.0", "clean-webpack-plugin": "^3.0.0", "commitizen": "^4.0.3", From 740983f85a20b26fed3003d8bcbca640b7b52ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=A1=E6=95=B0?= Date: Mon, 23 Aug 2021 19:04:29 +0800 Subject: [PATCH 2/3] fix: error --- babel.config.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/babel.config.js b/babel.config.js index 151c04285f..c429034fe2 100644 --- a/babel.config.js +++ b/babel.config.js @@ -8,19 +8,12 @@ module.exports = api => { const isTest = api.env('test'); if (isSite) { - console.log('-------------->') return { presets: [ '@babel/preset-env', // 'babel-preset-gatsby', { // silence: true // }, - [ - '@babel/preset-react', - { - development: isCommonJS - } - ] ], plugins: [ '@babel/plugin-proposal-optional-chaining', From 8d0456644de2107b39397028b04dec8d10a68ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=A1=E6=95=B0?= Date: Mon, 23 Aug 2021 19:15:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/babel.config.js b/babel.config.js index c429034fe2..411f735e9e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -11,6 +11,12 @@ module.exports = api => { return { presets: [ '@babel/preset-env', + [ + '@babel/preset-react', + { + development: isCommonJS + } + ], // 'babel-preset-gatsby', { // silence: true // },