From 03ed3008459472fe8cf72608335dd4f18d870dee Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Wed, 31 Mar 2021 16:06:32 +0800 Subject: [PATCH] fix: ignore babelrc in legacy plugin --- packages/plugin-legacy/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/plugin-legacy/index.js b/packages/plugin-legacy/index.js index 56ba4c10122161..0ecf2bd67b2ad5 100644 --- a/packages/plugin-legacy/index.js +++ b/packages/plugin-legacy/index.js @@ -226,6 +226,7 @@ function viteLegacyPlugin(options = {}) { // transform the legacy chunk with @babel/preset-env const sourceMaps = !!config.build.sourcemap const { code, map } = loadBabel().transform(raw, { + babelrc: false, configFile: false, compact: true, sourceMaps, @@ -408,6 +409,7 @@ function viteLegacyPlugin(options = {}) { function detectPolyfills(code, targets, list) { const { ast } = loadBabel().transform(code, { ast: true, + babelrc: false, configFile: false, presets: [ [