From 87fb78b90b67b8f7117d666ca14ab97d660468fd Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 24 Sep 2018 20:10:11 -0400 Subject: [PATCH] Prevent the cache of files using Babel Macros (#5078) * Add new overrides option * Add file to package.json * Create our own loader * Remove overrides * We have to use a real babel option * Add comments --- config/webpack.config.dev.js | 5 ++++- config/webpack.config.prod.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index d92cf597e7d..cb19f7f6b92 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -228,7 +228,10 @@ module.exports = { }, }, { - loader: require.resolve('babel-loader'), + // We need to use our own loader until `babel-loader` supports + // customization + // https://github.com/babel/babel-loader/pull/687 + loader: require.resolve('babel-preset-react-app/loader'), options: { // @remove-on-eject-begin babelrc: false, diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 6bd24c06401..5ab033bad31 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -266,7 +266,10 @@ module.exports = { // improves compile time on larger projects require.resolve('thread-loader'), { - loader: require.resolve('babel-loader'), + // We need to use our own loader until `babel-loader` supports + // customization + // https://github.com/babel/babel-loader/pull/687 + loader: require.resolve('babel-preset-react-app/loader'), options: { // @remove-on-eject-begin babelrc: false,