From d466ad0a095859a895fd4cb85f425ad4c4583e4e Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Thu, 1 Apr 2021 03:57:47 +0800 Subject: [PATCH] fix: ignore babelrc in legacy plugin (#2801) --- 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: [ [