Skip to content

Commit

Permalink
fix(storybook-babelrc): add emotion babel preset
Browse files Browse the repository at this point in the history
To get emotion css prop type to show in storybook, it is required to add the babel preset to
`.storybook/.config`. It does not appear to be necessary in `rollup.config.js` for `css` styles to
appear in storybook, but will leave it in case it's required for `site` to use these components
  • Loading branch information
micleners committed Oct 13, 2019
1 parent 68d6457 commit 1f22411
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"presets": [["@dsmjs", {"targets": {"browser": true}, "browser": true, "react": true}]]
"presets": [
["@dsmjs", {"targets": {"browser": true}, "browser": true, "react": true}],
"@emotion/babel-preset-css-prop"
]
}
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export default {
babel({
babelrc: false,
exclude: ['./node_modules/**'],
presets: [['@dsmjs', {targets: {browser: true}, react: true, modules: false}], '@emotion/babel-preset-css-prop'],
presets: [
['@dsmjs', {targets: {browser: true}, react: true, modules: false}],
'@emotion/babel-preset-css-prop'
],
plugins: [['transform-react-remove-prop-types', {mode: 'wrap'}]]
})
],
Expand Down

0 comments on commit 1f22411

Please sign in to comment.