2020-07-09 21:59:17 +03:00
|
|
|
// @ts-nocheck
|
|
|
|
const { ContextReplacementPlugin } = require('webpack');
|
|
|
|
|
2019-12-09 09:47:51 +02:00
|
|
|
const rootConfig = require('../webpack.config');
|
|
|
|
|
|
|
|
module.exports = async ({ config }) => ({
|
2020-05-24 02:08:24 +03:00
|
|
|
...config,
|
|
|
|
resolve: rootConfig.resolve,
|
2020-07-09 21:59:17 +03:00
|
|
|
|
2020-05-24 02:08:24 +03:00
|
|
|
module: {
|
|
|
|
...config.module,
|
|
|
|
// our rules should satisfy all storybook needs,
|
|
|
|
// so replace all storybook defaults with our rules
|
|
|
|
rules: rootConfig.module.rules,
|
|
|
|
},
|
2019-12-09 09:47:51 +02:00
|
|
|
|
2020-05-24 02:08:24 +03:00
|
|
|
resolveLoader: rootConfig.resolveLoader,
|
2020-07-09 21:59:17 +03:00
|
|
|
|
|
|
|
plugins: [
|
|
|
|
...config.plugins,
|
|
|
|
...rootConfig.plugins.filter((plugin) => plugin instanceof ContextReplacementPlugin),
|
|
|
|
],
|
2019-12-09 09:47:51 +02:00
|
|
|
});
|