From 1dfe85e736a7e91cac187a87a99604e1e11a2f98 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Thu, 9 Jul 2020 21:59:17 +0300 Subject: [PATCH] Improve storybook's performance by not building all possible locales/countries flags --- .storybook/webpack.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 8fa7048..61605e0 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,8 +1,12 @@ +// @ts-nocheck +const { ContextReplacementPlugin } = require('webpack'); + const rootConfig = require('../webpack.config'); module.exports = async ({ config }) => ({ ...config, resolve: rootConfig.resolve, + module: { ...config.module, // our rules should satisfy all storybook needs, @@ -11,4 +15,9 @@ module.exports = async ({ config }) => ({ }, resolveLoader: rootConfig.resolveLoader, + + plugins: [ + ...config.plugins, + ...rootConfig.plugins.filter((plugin) => plugin instanceof ContextReplacementPlugin), + ], });