Skip to content

Commit

Permalink
Added gatsby-plugin-styled-jsx (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek authored and KyleAMathews committed Aug 2, 2017
1 parent 249ef0e commit 3ab2cb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions packages/gatsby-plugin-styled-jsx/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
/*.js
!index.js
7 changes: 7 additions & 0 deletions packages/gatsby-plugin-styled-jsx/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exports.onRenderBody = ({setHeadComponents}, pluginOptions) => {
if (process.env.NODE_ENV === `production`) {
const flush = require('styled-jsx/server').default
const css = flush()
setHeadComponents([css])
}
}
8 changes: 4 additions & 4 deletions packages/gatsby-plugin-styled-jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "gatsby-plugin-styled-jsx",
"version": "1.0.1",
"description": "Stub description for gatsby-plugin-styled-jsx",
"description": "Adds SSR support for styled-jsx",
"author": "Tim Suchanek <tim.suchanek@gmail.com>",
"main": "index.js",
"scripts": {
"build": "babel src --out-dir . --ignore __tests__",
Expand All @@ -10,9 +11,8 @@
"keywords": [
"gatsby"
],
"author": "Kyle Mathews &lt;mathews.kyle@gmail.com&gt;",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.24.1"
"dependencies": {
"styled-jsx": "^1.0.10"
}
}

0 comments on commit 3ab2cb1

Please sign in to comment.