Skip to content

Commit

Permalink
fix storybook hardsource errors (microsoft#13691)
Browse files Browse the repository at this point in the history
  • Loading branch information
xugao committed Jun 18, 2020
1 parent 8800f1c commit d4a8768
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion scripts/storybook/webpack.config.js
Expand Up @@ -77,7 +77,21 @@ module.exports = ({ config }) => {

config.resolve.alias = getResolveAlias();

config.plugins.push(new HardSourceWebpackPlugin(), new IgnoreNotFoundExportWebpackPlugin({ include: [/\.tsx?$/] }));
config.plugins.push(
new HardSourceWebpackPlugin(),
new HardSourceWebpackPlugin.ExcludeModulePlugin([
{
// HardSource works with mini-css-extract-plugin but due to how
// mini-css emits assets, assets are not emitted on repeated builds with
// mini-css and hard-source together. Ignoring the mini-css loader
// modules, but not the other css loader modules, excludes the modules
// that mini-css needs rebuilt to output assets every time.
// https://github.com/mzgoddard/hard-source-webpack-plugin/issues/416
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/,
},
]),
new IgnoreNotFoundExportWebpackPlugin({ include: [/\.tsx?$/] }),
);

config.optimization.minimize = false;

Expand Down

0 comments on commit d4a8768

Please sign in to comment.