From 31d8635f5f9287a118fe3cb14bd42db76b857a5f Mon Sep 17 00:00:00 2001 From: Swashata Ghosh Date: Sat, 20 Oct 2018 12:40:43 +0530 Subject: [PATCH] feat: remove babelrc and babel.config from babel-loader If present, it could conflict with tooling when used in a wrong way. We already provide jsBabelOverride for that, so if needed user can enable it again. Closes #11 --- .../__snapshots__/WebpackConfigHelper.spec.ts.snap | 4 ++++ packages/scripts/src/config/WebpackConfigHelper.ts | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/scripts/__tests__/config/__snapshots__/WebpackConfigHelper.spec.ts.snap b/packages/scripts/__tests__/config/__snapshots__/WebpackConfigHelper.spec.ts.snap index a43499a1e..c835fa086 100644 --- a/packages/scripts/__tests__/config/__snapshots__/WebpackConfigHelper.spec.ts.snap +++ b/packages/scripts/__tests__/config/__snapshots__/WebpackConfigHelper.spec.ts.snap @@ -32,6 +32,8 @@ Object { Object { "loader": "babel-loader", "options": Object { + "babelrc": false, + "configFile": false, "presets": Array [ Array [ "@wpackio/base", @@ -51,6 +53,8 @@ Object { Object { "loader": "babel-loader", "options": Object { + "babelrc": false, + "configFile": false, "presets": Array [ Array [ "@wpackio/base", diff --git a/packages/scripts/src/config/WebpackConfigHelper.ts b/packages/scripts/src/config/WebpackConfigHelper.ts index 8da519acf..f2c76e981 100644 --- a/packages/scripts/src/config/WebpackConfigHelper.ts +++ b/packages/scripts/src/config/WebpackConfigHelper.ts @@ -325,6 +325,11 @@ ${bannerConfig.copyrightText}${bannerConfig.credit ? creditNote : ''}`, options: this.getOverrideWebpackRuleOptions( { presets: jsPresets, + // disable babelrc and babel.config.js + // as it could potentially break stuff + // rather use the jsBabelOverride + configFile: false, + babelrc: false, }, this.config.jsBabelOverride ), @@ -352,6 +357,11 @@ ${bannerConfig.copyrightText}${bannerConfig.credit ? creditNote : ''}`, options: this.getOverrideWebpackRuleOptions( { presets: tsPresets, + // disable babelrc and babel.config.js + // as it could potentially break stuff + // rather use the jsBabelOverride + configFile: false, + babelrc: false, // We don't need plugin-proposal-class-properties // because taken care of by @wpackio/base // '@babel/proposal-class-properties',