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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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 ?
install --save react-app-rewire-styled-components
ternatively if you have yarn installed
add react-app-rewire-styled-components
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.
Licensed under the MIT License, Copyright ©? 2017 Maximilian Stoiber. See LICENSE.md for more information.