Improve storybook's performance by not building all possible locales/countries flags

This commit is contained in:
ErickSkrauch 2020-07-09 21:59:17 +03:00
parent 70070ef516
commit 1dfe85e736
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E

View File

@ -1,8 +1,12 @@
// @ts-nocheck
const { ContextReplacementPlugin } = require('webpack');
const rootConfig = require('../webpack.config'); const rootConfig = require('../webpack.config');
module.exports = async ({ config }) => ({ module.exports = async ({ config }) => ({
...config, ...config,
resolve: rootConfig.resolve, resolve: rootConfig.resolve,
module: { module: {
...config.module, ...config.module,
// our rules should satisfy all storybook needs, // our rules should satisfy all storybook needs,
@ -11,4 +15,9 @@ module.exports = async ({ config }) => ({
}, },
resolveLoader: rootConfig.resolveLoader, resolveLoader: rootConfig.resolveLoader,
plugins: [
...config.plugins,
...rootConfig.plugins.filter((plugin) => plugin instanceof ContextReplacementPlugin),
],
}); });