From e57a1968d0730ef73b6bf5a2a7258f7a3b7b0344 Mon Sep 17 00:00:00 2001 From: Grady Kuhnline Date: Sun, 1 Jul 2018 10:39:05 -0700 Subject: [PATCH] add postcss-preset-env, remove autoprefixer --- packages/react-scripts/config/webpack.config.dev.js | 7 ++++--- packages/react-scripts/config/webpack.config.prod.js | 7 ++++--- packages/react-scripts/package.json | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index cb19f7f6b92..71607cf6795 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -8,7 +8,6 @@ // @remove-on-eject-end 'use strict'; -const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -57,8 +56,10 @@ const getStyleLoaders = (cssOptions, preProcessor) => { ident: 'postcss', plugins: () => [ require('postcss-flexbugs-fixes'), - autoprefixer({ - flexbox: 'no-2009', + require('postcss-preset-env')({ + autoprefixer: { + flexbox: 'no-2009', + }, }), ], }, diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 5ab033bad31..0d0c077f2bf 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -8,7 +8,6 @@ // @remove-on-eject-end 'use strict'; -const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -69,8 +68,10 @@ const getStyleLoaders = (cssOptions, preProcessor) => { ident: 'postcss', plugins: () => [ require('postcss-flexbugs-fixes'), - autoprefixer({ - flexbox: 'no-2009', + require('postcss-preset-env')({ + autoprefixer: { + flexbox: 'no-2009', + }, }), ], sourceMap: shouldUseSourceMap, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 69cc9742856..93627fd1db2 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -24,7 +24,6 @@ "@babel/core": "7.1.0", "@babel/runtime": "7.0.0", "@svgr/webpack": "2.4.1", - "autoprefixer": "9.1.5", "babel-core": "7.0.0-bridge.0", "babel-eslint": "9.0.0", "babel-jest": "23.6.0", @@ -55,6 +54,7 @@ "optimize-css-assets-webpack-plugin": "5.0.1", "postcss-flexbugs-fixes": "4.1.0", "postcss-loader": "3.0.0", + "postcss-preset-env": "6.0.6", "postcss-safe-parser": "4.0.1", "promise": "8.0.2", "raf": "3.4.0",