From ad424231cb8b6dcd70bb30d98fc3f98f9f92db32 Mon Sep 17 00:00:00 2001 From: Babatunde Olusola Date: Wed, 2 Aug 2023 15:26:37 +0100 Subject: [PATCH] fix: update webpack common config to fix errors (#428) --- config/webpack.common.config.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/webpack.common.config.js b/config/webpack.common.config.js index 62c3aa348..871e2b937 100644 --- a/config/webpack.common.config.js +++ b/config/webpack.common.config.js @@ -19,4 +19,22 @@ module.exports = { }, extensions: ['.js', '.jsx'], }, + ignoreWarnings: [ + // Ignore warnings raised by source-map-loader. + // some third party packages may ship miss-configured sourcemaps, that interrupts the build + // See: https://github.com/facebook/create-react-app/discussions/11278#discussioncomment-1780169 + /** + * + * @param {import('webpack').WebpackError} warning + * @returns {boolean} + */ + function ignoreSourcemapsloaderWarnings(warning) { + return ( + warning.module + && warning.module.resource.includes('node_modules') + && warning.details + && warning.details.includes('source-map-loader') + ); + }, + ], };