Releases: styled-components/babel-plugin-styled-components
v1.9.0
Add support for the css
prop!
See https://medium.com/styled-components/announcing-native-support-for-the-css-prop-in-styled-components-245ca5252feb for more information
v1.8.0
v1.7.1
v1.7.0
This minor release reintroduces "pure" annotation of styled components and the various library helper methods. It is off by default, so if you want to turn it on pass this config to the plugin:
.babelrc
{
"plugins": [
["babel-plugin-styled-components", { "pure": true }]
]
}
"pure" annotation helps signal to minifiers like uglify that a piece of code is safe to remove if not used in at least one other place. This means if you have any components lying around that you're not actively using, they'll be dead code eliminated with this featured enabled. That goes for the helpers too like createGlobalStyle
, keyframes
, and css
.
v1.6.4
v1.6.3
v1.6.0
Features
-
Automatically desugar
styled.{element}
tostyled(element)
(#125) This allows for the next item to work and save bytes in the resulting JS bundle. -
Added new "no-tags" import rewriting functionality when using styled-components >= v4 (#150)
Fixes
-
Single line JS-style comments in the styles now work properly with an interpolation on the same line (#155), e.g.
styled.div` color: green; // text-align: ${props => props.align}; `
Misc
-
Removed "uglifyPure" functionality. Unfortunately this experiment didn't have the effect we wanted and in most cases dramatically slowed down people's builds.
-
SSR mode is now on by default. There's no downside to enabling it and stable class names are always a good thing. (#82)
-
Deleted all files related to the "preprocess" functionality that was deprecated.
v1.5.1
v1.5.0
Changes
Add "PURE" annotations for Uglify.js
Thanks to @osamajandali
The plugin will now add annotations to styled
, css
, and keyframes
calls, that help Uglify to perform better dead code elimination.
So a small snippet like this:
const Simple = styled.div`
width: 100%;
`;
Will now be annotated using /*#__PURE__*/
, like this:
const Simple = /*#__PURE__*/styled.div (...);