babel-plugin-styled-components-require
Babel plugin that adds styled-components import declaration.
Example
Your component.js
that contains this code:
const Card = styleddiv` background: #FFF; border: 1px solid #DDD; border-radius: 2px; padding: 10px;`;;
will be transpiled to:
; const Card = styleddiv` background: #FFF; border: 1px solid #DDD; border-radius: 2px; padding: 10px;`;;
Usage
npm install babel-plugin-styled-components-require --save-dev
Add styled-components-require
into .babelrc
Tests
✓ add import statement if styled.*
is present
✓ do not add to already transpiled code
✓ do not add import styled-components twice
✓ do not add if it already imported
You like?
⭐️ this repo
License
MIT © siddharthkp