From 9535e02ca1ee8e547b469695ca3cc3b14434dd53 Mon Sep 17 00:00:00 2001 From: Daniel Duan Date: Thu, 18 May 2017 12:39:07 -0400 Subject: [PATCH] Upgraded webpack PostCSS plugin definition --- .../server/config/defaults/webpack.config.js | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/app/react/src/server/config/defaults/webpack.config.js b/app/react/src/server/config/defaults/webpack.config.js index b82ed7b4864f..0dd3b719f35a 100644 --- a/app/react/src/server/config/defaults/webpack.config.js +++ b/app/react/src/server/config/defaults/webpack.config.js @@ -5,18 +5,7 @@ import { includePaths, excludePaths } from '../utils'; // Add a default custom config which is similar to what React Create App does. module.exports = storybookBaseConfig => { const newConfig = { ...storybookBaseConfig }; - newConfig.plugins = [ - ...storybookBaseConfig.plugins, - new webpack.LoaderOptionsPlugin({ - options: { - postcss: [ - autoprefixer({ - browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'], - }), - ], - }, - }), - ]; + newConfig.module.rules = [ ...storybookBaseConfig.module.rules, { @@ -31,7 +20,16 @@ module.exports = storybookBaseConfig => { importLoaders: 1, }, }, - 'postcss-loader', + { + loader: 'postcss-loader', + options: { + plugins: () => [ + autoprefixer({ + browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'], + }), + ], + }, + }, ], }, {