From b434dfe1a0430c442a185e4c0d91a01c6c54d777 Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Wed, 13 Dec 2023 10:02:30 +0100 Subject: [PATCH] handle source map warnings for packages not using webpack 5 --- craco.config.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/craco.config.js b/craco.config.js index 9a4f262f..5e10e87d 100644 --- a/craco.config.js +++ b/craco.config.js @@ -11,7 +11,19 @@ module.exports = { "http": require.resolve("stream-http"), "https": require.resolve("https-browserify") }, - } + }; + + webpackConfig.ignoreWarnings = [ + function ignoreSourcemapsloaderWarnings(warning) { + return ( + warning.module && + warning.module.resource.includes("node_modules") && + warning.details && + warning.details.includes("source-map-loader") + ); + }, + ]; + return webpackConfig; }, }, -- GitLab