1.0.0 • Published 8 years ago
react-app-rewire-styled v1.0.0
react-app-rewire-styled
Add styled-components babel plugin to create-react-app using react-app-rewired
Add the styled-components to create-react-app app via react-app-rewired
Installation
yarn add --dev react-app-rewire-styledOR
npm install --save-dev react-app-rewire-styledUsage
In the config-overrides.js you created for react-app-rewired add this code:
const rewireStyled = require('react-app-rewire-styled');
/* config-overrides.js */
module.exports = function override(config, env) {
return rewireStyled(config, env, { inline: true });
}Usage with Storybook
When using @storybooks/storybook with CRA via getstorybook, create a webpack.config.js file in .storybook folder and add this code:
const rewireStyled = require('react-app-rewire-styled');
module.exports = function override(config, env) {
return rewireStyled(config, env, { inline: true });
};Inspirations
react-app-rewire-styled-components by @mxstbr
License
Licensed under MIT License, Copyright @ 2017 osdevisnot. See LICENSE.md for more details.