From 9cac139db7183355263ed5ed04c3875d4d9d3467 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Tue, 3 Dec 2024 10:53:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(frontend)=20ignore=20@formatjs/fas?= =?UTF-8?q?t-memoize=20source=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the latest version of @formatjs, a warning during webpack build is displayed. Actually, on source map generation, there is an issue with the latest version of the package `@formatjs/fast-memoize` So as a workaround, we tweak our webpack config to ignore this package on source map generation. https://github.com/formatjs/formatjs/issues/4725 --- src/frontend/webpack.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/frontend/webpack.config.js b/src/frontend/webpack.config.js index a3af322821..ca852d86a4 100644 --- a/src/frontend/webpack.config.js +++ b/src/frontend/webpack.config.js @@ -99,7 +99,16 @@ module.exports = (env) => { }, }, // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. - { enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' }, + { + enforce: 'pre', + test: /\.js$/, + loader: 'source-map-loader', + options: { + filterSourceMappingUrl: (url, resourcePath) => { + return !/@formatjs\/fast-memoize/i.test(resourcePath); + }, + }, + }, ], },