canuzunoglu / react-app-rewire-styled-components

Add the styled-components Babel plugin to your create-react-app app via react-app-rewired

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-app-rewire-styled-components

Add the babel-plugin-styled-components to your create-react-app app via react-app-rewired.

This gives you nicer generated class names that include the components' name, minification of styles and many more goodies 💪

Installation

npm install --save react-app-rewire-styled-components
# alternatively if you have yarn installed
yarn add react-app-rewire-styled-components

Usage

In the config-overrides.js you created for react-app-rewired add this code:

const rewireStyledComponents = require('react-app-rewire-styled-components');

/* config-overrides.js */
module.exports = function override(config, env) {
  config = rewireStyledComponents(config, env);
  return config;
}

That's it, you're now using the styled-components Babel plugin!

License

Licensed under the MIT License, Copyright ©️ 2017 Maximilian Stoiber. See LICENSE.md for more information.

About

Add the styled-components Babel plugin to your create-react-app app via react-app-rewired

License:MIT License


Languages

Language:JavaScript 100.0%