summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-28 17:38:39 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-29 19:02:52 +0100
commit67ce6cc19cbfdf9692dc785d2fc88ecee4ed500c (patch)
tree6c393ee6a96752c6349768f256ee5e6fdb51d587
parent29658cdcd1c112eb9d0ce66b75f1baf77532f265 (diff)
build: configure webpack to use react-intl without parser
-rw-r--r--next.config.js7
1 files changed, 6 insertions, 1 deletions
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/,