From ce0fb9978ca583040ca2228c28153869289971b8 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Tue, 3 Nov 2020 10:42:47 -0800 Subject: [PATCH] remove @babel/preset-modules --- .../next/build/webpack/plugins/next-esm-plugin.ts | 8 ++++++-- packages/next/package.json | 1 - yarn.lock | 11 ----------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/next/build/webpack/plugins/next-esm-plugin.ts b/packages/next/build/webpack/plugins/next-esm-plugin.ts index c45a76d8c954c..e4d526434b487 100644 --- a/packages/next/build/webpack/plugins/next-esm-plugin.ts +++ b/packages/next/build/webpack/plugins/next-esm-plugin.ts @@ -164,8 +164,12 @@ export class NextEsmPlugin implements Plugin { if (IS_PRESET_ENV.test(name)) { presets.push([ - require.resolve('@babel/preset-modules'), - { loose: true }, + require.resolve('@babel/preset-env'), + { + bugfixes: true, + loose: true, + targets: { esmodules: true }, + }, ]) } else { presets.push([name, opts]) diff --git a/packages/next/package.json b/packages/next/package.json index 799b48c7e2cd4..407188d2bbc44 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -73,7 +73,6 @@ "@babel/plugin-transform-modules-commonjs": "7.10.4", "@babel/plugin-transform-runtime": "7.11.5", "@babel/preset-env": "7.11.5", - "@babel/preset-modules": "0.1.4", "@babel/preset-react": "7.10.4", "@babel/preset-typescript": "7.10.4", "@babel/runtime": "7.11.2", diff --git a/yarn.lock b/yarn.lock index 1a906f4c5eccd..0bbeaaf01bc3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1355,17 +1355,6 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-transform-flow-strip-types" "^7.10.4" -"@babel/preset-modules@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - "@babel/preset-modules@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.3.tgz#13242b53b5ef8c883c3cf7dddd55b36ce80fbc72"