From 7b9b36f2822f40104c605d0e75c31c2cba0538d4 Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Wed, 10 Jan 2018 02:39:13 +1000 Subject: [PATCH] Move browsers to cross-tool config (#3644) --- packages/react-scripts/config/webpack.config.dev.js | 6 ------ packages/react-scripts/config/webpack.config.prod.js | 6 ------ packages/react-scripts/scripts/init.js | 7 +++++++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 9f3131b0660..843ec0dd318 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -200,12 +200,6 @@ module.exports = { plugins: () => [ require('postcss-flexbugs-fixes'), autoprefixer({ - browsers: [ - '>1%', - 'last 4 versions', - 'Firefox ESR', - 'not ie < 9', // React doesn't support IE8 anyway - ], flexbox: 'no-2009', }), ], diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index b99db8a27ef..2f37dbfe7f4 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -222,12 +222,6 @@ module.exports = { plugins: () => [ require('postcss-flexbugs-fixes'), autoprefixer({ - browsers: [ - '>1%', - 'last 4 versions', - 'Firefox ESR', - 'not ie < 9', // React doesn't support IE8 anyway - ], flexbox: 'no-2009', }), ], diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index b283bad6ee6..27b214e6431 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -43,6 +43,13 @@ module.exports = function( eject: 'react-scripts eject', }; + appPackage.browserslist = [ + '>1%', + 'last 4 versions', + 'Firefox ESR', + 'not ie < 9', + ]; + fs.writeFileSync( path.join(appPath, 'package.json'), JSON.stringify(appPackage, null, 2)