withspectrum/react-app-rewire-styled-components

Name: react-app-rewire-styled-components

Owner: Spectrum

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

Created: 2017-06-17 10:45:49.0

Updated: 2018-05-23 22:36:56.0

Pushed: 2018-03-21 16:26:27.0

Homepage: null

Size: 56

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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
install --save react-app-rewire-styled-components
ternatively if you have yarn installed
 add react-app-rewire-styled-components
Usage

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

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

onfig-overrides.js */
le.exports = function override(config, env) {
nfig = rewireStyledComponents(config, env);
turn config;

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

To pass options to the Babel plugin use the third argument, it passes straight through to the plugin:

ig = rewireStyledComponents(config, env, {
r: true,

See the available options in the styled-components documentation.

License

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.