Created
September 2, 2019 09:37
-
-
Save axross/9f8efcb9282a3bc2dec902dc0e2aff9a to your computer and use it in GitHub Desktop.
This file contains 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 * as React from "react"; | |
import * as ReactDOMServer from "react-dom/server"; | |
function SomeComponent() { | |
return React.createElement(StyledDiv, null, "Hello!"); | |
} | |
const StyledDiv = styled.div` | |
color: red; | |
`; | |
const rendered = ReactDOMServer.renderToString(React.createElement(StyledDiv)); |
This file contains 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 path = require("path"); | |
module.exports = { | |
mode: "development", | |
target: "node", | |
entry: "./main.js", | |
output: { | |
path: path.resolve(__dirname, "./"), | |
filename: "[name].bundled.js" | |
}, | |
resolve: { | |
alias: { | |
"react-dom/server": path.resolve( | |
__dirname, | |
"./node_modules/react-dom/server.browser.js" | |
) | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment