Skip to content

Commit a086302

Browse files
KnisterPetersapegin
authored andcommitted
Fix: Basic webpack 4 support (styleguidist#849)
To have webpack 4 configured correctly we need to set the webpack mode.
1 parent 1ce5fd6 commit a086302

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/make-webpack-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const merge = require('webpack-merge');
1010
const forEach = require('lodash/forEach');
1111
const mergeWebpackConfig = require('./utils/mergeWebpackConfig');
1212
const StyleguidistOptionsPlugin = require('./utils/StyleguidistOptionsPlugin');
13+
const getWebpackVersion = require('./utils/getWebpackVersion');
1314

1415
const RENDERER_REGEXP = /Renderer$/;
1516

@@ -51,6 +52,10 @@ module.exports = function(config, env) {
5152
},
5253
};
5354

55+
if (getWebpackVersion() >= 4) {
56+
webpackConfig.mode = env;
57+
}
58+
5459
if (isProd) {
5560
webpackConfig = merge(webpackConfig, {
5661
output: {

0 commit comments

Comments
 (0)