babel-plugin-emotion should not be a runtime dependency
Current behavior:
For the installed emotion package, babel-plugin-emotion is a dev-dependencies, but it is in dependencies section. I have to install babel-plugin-emotion in my production environment.
{
"name": "emotion",
"version": "10.0.6",
"dependencies": {
"babel-plugin-emotion": "^10.0.6",
"create-emotion": "^10.0.6"
},
"devDependencies": {
"@emotion/stylis": "0.8.3",
"babel-plugin-transform-define": "^1.3.0",
"dtslint": "^0.3.0",
"stylis": "3.5.4",
"stylis-rule-sheet": "^0.0.10"
}
}
To reproduce:
- install this package
- open node_modules/emotion/package.json
Expected behavior:
babel-plugin-emotion should not be part of dependencies.
Environment information:
-
reactversion: -
@emotion/reactversion:
Current emotion veriosn is v11 and emotion package be deprecated.
// https://cdn.jsdelivr.net/npm/[email protected]/dist/emotion.esm.js
throw new Error("The `emotion` package has been renamed to `@emotion/css`.
Please import it like this `import { css } from '@emotion/css'`.");
Please use emotion v11 and you will not encounter this issue.
@puncha that is because we support emotion/macro in v10 (and @emotion/css/macro in v11). For that, you need babel-plugin-emotion. I don't believe that it's a big deal to put that in dependencies as it simplifies the installation instructions for users of the /macro variant.
I need to have a list of all dependencies in the project for analysis. It is very frustrating to have source-map, cosmiconfig in dependencies (because they are dependencies for @emotion/babel-plugin.
Looks like not all use @emotion/babel-plugin, why not install it separately?