mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Update example with emotion (#2837)
* Update example with emotion Emotion is now split into separate packages using Lerna. * Update Next.js in emotion example
This commit is contained in:
parent
50866c234c
commit
3c92524b06
|
@ -3,6 +3,6 @@
|
||||||
"next/babel"
|
"next/babel"
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
["emotion/babel", { "inline": true }]
|
["emotion", { "inline": true }]
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -7,10 +7,13 @@
|
||||||
"start": "next start"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"emotion": "^5.1.4",
|
"babel-plugin-emotion": "^7.1.0",
|
||||||
"next": "^2.4.6",
|
"emotion": "^7.2.0",
|
||||||
|
"emotion-server": "^7.2.0",
|
||||||
|
"next": "^3.0.6",
|
||||||
"react": "^15.6.1",
|
"react": "^15.6.1",
|
||||||
"react-dom": "^15.6.1"
|
"react-dom": "^15.6.1",
|
||||||
|
"react-emotion": "^7.2.0"
|
||||||
},
|
},
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import Document, { Head, Main, NextScript } from 'next/document'
|
import Document, { Head, Main, NextScript } from 'next/document'
|
||||||
import { extractCritical } from 'emotion/server'
|
import { extractCritical } from 'emotion-server'
|
||||||
import { flush } from 'emotion'
|
import { flush } from 'emotion'
|
||||||
|
|
||||||
const dev = process.env.NODE_ENV !== 'production'
|
const dev = process.env.NODE_ENV !== 'production'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { hydrate, keyframes, css, injectGlobal } from 'emotion'
|
import { hydrate, keyframes, css, injectGlobal } from 'emotion'
|
||||||
import styled from 'emotion/react'
|
import styled from 'react-emotion'
|
||||||
|
|
||||||
// Adds server generated styles to emotion cache.
|
// Adds server generated styles to emotion cache.
|
||||||
// '__NEXT_DATA__.ids' is set in '_document.js'
|
// '__NEXT_DATA__.ids' is set in '_document.js'
|
||||||
|
|
Loading…
Reference in a new issue