Skip to content

Commit

Permalink
Fix: Basic webpack 4 support (#849)
Browse files Browse the repository at this point in the history
To have webpack 4 configured correctly we need to set the webpack mode.
  • Loading branch information
KnisterPeter authored and sapegin committed Mar 2, 2018
1 parent 1ce5fd6 commit a086302
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/make-webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const merge = require('webpack-merge');
const forEach = require('lodash/forEach');
const mergeWebpackConfig = require('./utils/mergeWebpackConfig');
const StyleguidistOptionsPlugin = require('./utils/StyleguidistOptionsPlugin');
const getWebpackVersion = require('./utils/getWebpackVersion');

const RENDERER_REGEXP = /Renderer$/;

Expand Down Expand Up @@ -51,6 +52,10 @@ module.exports = function(config, env) {
},
};

if (getWebpackVersion() >= 4) {
webpackConfig.mode = env;
}

if (isProd) {
webpackConfig = merge(webpackConfig, {
output: {
Expand Down

0 comments on commit a086302

Please sign in to comment.