From 67ce6cc19cbfdf9692dc785d2fc88ecee4ed500c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 28 Jan 2022 17:38:39 +0100 Subject: build: configure webpack to use react-intl without parser --- next.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index a26eda6..3583639 100644 --- a/next.config.js +++ b/next.config.js @@ -30,7 +30,12 @@ const nextConfig = { path.join(__dirname, 'node_modules'), ], }, - webpack: (config) => { + webpack: (config, { dev }) => { + if (!dev) { + // https://formatjs.io/docs/guides/advanced-usage#react-intl-without-parser-40-smaller + config.resolve.alias['@formatjs/icu-messageformat-parser'] = + '@formatjs/icu-messageformat-parser/no-parser'; + } config.module.rules.push( { test: /\.pdf/, -- cgit v1.2.3