Socket
Socket
Sign inDemoInstall

babel-plugin-emotion-rename

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-emotion-rename

Babel plugin to rename old Emotion 9 import to new Emotion 10+ import


Version published
Weekly downloads
28
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-emotion-rename npm

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

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

FAQs

Package last updated on 13 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc