From faa23f2b563659af52321660f3a001a10c542558 Mon Sep 17 00:00:00 2001 From: underfin Date: Mon, 29 Mar 2021 22:47:55 +0800 Subject: [PATCH] fix: ignore babelrc fix #2722 --- packages/playground/react/package.json | 5 +++++ packages/plugin-react-refresh/index.js | 1 + packages/plugin-vue-jsx/index.js | 1 + 3 files changed, 7 insertions(+) diff --git a/packages/playground/react/package.json b/packages/playground/react/package.json index 845ac6c8bbfed3..18a7edd74fa339 100644 --- a/packages/playground/react/package.json +++ b/packages/playground/react/package.json @@ -14,5 +14,10 @@ }, "devDependencies": { "@vitejs/plugin-react-refresh": "^1.3.1" + }, + "babel": { + "presets": [ + "@babel/preset-env" + ] } } diff --git a/packages/plugin-react-refresh/index.js b/packages/plugin-react-refresh/index.js index 0a5cc8056f915e..a68875e5df2b83 100644 --- a/packages/plugin-react-refresh/index.js +++ b/packages/plugin-react-refresh/index.js @@ -102,6 +102,7 @@ function reactRefreshPlugin(opts) { const isReasonReact = id.endsWith('.bs.js') const result = transformSync(code, { + babelrc: false, configFile: false, filename: id, parserOpts: { diff --git a/packages/plugin-vue-jsx/index.js b/packages/plugin-vue-jsx/index.js index 0f15b97fa35cbb..52a1e1a44020ca 100644 --- a/packages/plugin-vue-jsx/index.js +++ b/packages/plugin-vue-jsx/index.js @@ -82,6 +82,7 @@ function vueJsxPlugin(options = {}) { } const result = babel.transformSync(code, { + babelrc: false, ast: true, plugins, sourceMaps: needSourceMap,