Skip to content

Commit bd70102

Browse files
okonetsapegin
authored andcommitted
Fix: Ignore mini-html-webpack-plugin (styleguidist#938)
Fixes styleguidist#937
1 parent 1d4828a commit bd70102

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

docs/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ module.exports = {
664664
665665
> **Note:** `entry`, `externals`, `output`, `watch`, and `stats` options will be ignored. For production builds, `devtool` will also be ignored.
666666
667-
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
667+
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `MiniHtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
668668
669669
> **Note:** Run style guide in verbose mode to see the actual webpack config used by Styleguidist: `npx styleguidist server --verbose`.
670670

docs/Webpack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343

4444
> **Note:** `entry`, `externals`, `output`, `watch`, and `stats` options will be ignored. For production builds, `devtool` will also be ignored.
4545
46-
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
46+
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `MiniHtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
4747
4848
> **Note:** If your loaders don’t work with Styleguidist try to make `include` and `exclude` absolute paths.
4949
@@ -81,7 +81,7 @@ module.exports = {
8181
8282
> **Note:** `entry`, `externals`, `output`, `watch`, and `stats` options will be ignored. For production builds, `devtool` will also be ignored.
8383
84-
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
84+
> **Note:** `CommonsChunkPlugins`, `HtmlWebpackPlugin`, `MiniHtmlWebpackPlugin`, `UglifyJsPlugin`, `HotModuleReplacementPlugin` plugins will be ignored because Styleguidist already includes them or they may break Styleguidist.
8585
8686
## Create React App
8787

scripts/utils/__tests__/mergeWebpackConfig.spec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import mergeWebpackConfig from '../mergeWebpackConfig';
22

33
class UglifyJsPlugin {}
44
class MyPlugin {}
5+
class MiniHtmlWebpackPlugin {}
56

67
it('should merge two objects', () => {
78
const result = mergeWebpackConfig({ a: 0, b: 0 }, { b: 1 });
@@ -26,15 +27,18 @@ it('should ignore certain sections', () => {
2627
});
2728

2829
it('should ignore certain Webpack plugins', () => {
30+
const baseInstance = new UglifyJsPlugin();
31+
const userInstance = new UglifyJsPlugin();
2932
const result = mergeWebpackConfig(
3033
{
31-
plugins: [new UglifyJsPlugin()],
34+
plugins: [baseInstance],
3235
},
3336
{
34-
plugins: [new UglifyJsPlugin(), new MyPlugin()],
37+
plugins: [userInstance, new MyPlugin(), new MiniHtmlWebpackPlugin()],
3538
}
3639
);
3740
expect(result.plugins).toHaveLength(2);
41+
expect(result.plugins[0]).toBe(baseInstance);
3842
expect(result.plugins[0].constructor.name).toBe('UglifyJsPlugin');
3943
expect(result.plugins[1].constructor.name).toBe('MyPlugin');
4044
});

scripts/utils/mergeWebpackConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const IGNORE_SECTIONS_ENV = {
1212

1313
const IGNORE_PLUGINS = [
1414
'CommonsChunkPlugins',
15+
'MiniHtmlWebpackPlugin',
1516
'HtmlWebpackPlugin',
1617
'OccurrenceOrderPlugin',
1718
'DedupePlugin',

0 commit comments

Comments
 (0)