Skip to content

Instantly share code, notes, and snippets.

@andrewodri
Last active February 11, 2018 08:53
Show Gist options
  • Save andrewodri/bd55a68e6bceb545f668afb85acd828e to your computer and use it in GitHub Desktop.
Save andrewodri/bd55a68e6bceb545f668afb85acd828e to your computer and use it in GitHub Desktop.
Monkey patch to add postcss-cssnext to create-react-app
{
"name": "create-react-app-example",
"version": "0.1.0",
"private": true,
"dependencies": {
"postcss-cssnext": "^3.0.2",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-scripts": "1.0.17"
},
"scripts": {
"postinstall": "sed -i.bak \"s/\\srequire('postcss-flexbugs-fixes')/require('postcss-cssnext'),require('postcss-flexbugs-fixes')/g\" node_modules/react-scripts/config/webpack.config.dev.js && sed -i.bak \"s/\\srequire('postcss-flexbugs-fixes')/require('postcss-cssnext'),require('postcss-flexbugs-fixes')/g\" node_modules/react-scripts/config/webpack.config.prod.js",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment