1.0.0-beta.27 • Published 1 year ago
babel-plugin-emotion-rename v1.0.0-beta.27
babel-plugin-emotion-rename
Automatically rename legacy emotion imports to new supported emotion versions
Demo repository with Webpack+Babel+React+Emotion11
How it works
- Scan all imports, try to rename legacy import from
emotion
/react-emotion
to@emotion/css
- If it used styled, add additional new import
@emotion/styled
- If the emotion.css is used within styled, swap with css method from
@emotion/react
Compatibility:
- Legacy v9 to v11
- Some things may not be working, please checkout with caution!
- If you're using SSR, It's very recommended to also implement
@emotion/css
SSR integration as well for smoother migration
Known issues:
- If you import a variable from another file, and that variable is used within styled/css tagged template literal, then it's currently impossible to statically analyze and rename the import
Install
$ npm install --save-dev babel-plugin-emotion-rename
babelrc
{
"plugins": ["babel-plugin-emotion-rename"]
}
Codemod
- Codemod CLI coming soon, so that we can drop runtime transpilation step.
License
MIT
1.0.0-beta.22
1 year ago
1.0.0-beta.23
1 year ago
1.0.0-beta.20
1 year ago
1.0.0-beta.21
1 year ago
1.0.0-beta.26
1 year ago
1.0.0-beta.27
1 year ago
1.0.0-beta.24
1 year ago
1.0.0-beta.25
1 year ago
1.0.0-beta.19
1 year ago
1.0.0-beta.2
1 year ago
1.0.0-beta.3
1 year ago
1.0.0-beta.4
1 year ago
1.0.0-beta.5
1 year ago
1.0.0-beta.11
1 year ago
1.0.0-beta.12
1 year ago
1.0.0-beta.10
1 year ago
1.0.0-beta.6
1 year ago
1.0.0-beta.7
1 year ago
1.0.0-beta.8
1 year ago
1.0.0-beta.9
1 year ago
1.0.0-beta.17
1 year ago
1.0.0-beta.18
1 year ago
1.0.0-beta.15
1 year ago
1.0.0-beta.13
1 year ago
1.0.0-beta.14
1 year ago
1.0.0-beta.1
2 years ago