Last active
September 10, 2019 18:34
-
-
Save modernserf/4d9b8a3fd86c9e4e3d6aa5249f585b8a to your computer and use it in GitHub Desktop.
How do I get the styled components plugin to work here?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code should have been transformed, right?? | |
import styled from 'styled-components'; | |
const Foo = styled.div` | |
color: pink; | |
`; | |
export { Foo }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const babel = require("rollup-plugin-babel"); | |
module.exports = { | |
input: "src/index.js", | |
output: [ | |
{ | |
file: "build/main.js", | |
format: "cjs" | |
}, | |
{ | |
file: "build/module.js", | |
format: "esm" | |
} | |
], | |
plugins: [ | |
babel({ | |
plugins: ["styled-components"] | |
}) | |
] | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
export const Foo = styled.div` | |
color: pink; | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment