Unverified Commit 9df9d4ae authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Fix build stalling with styled-jsx plugins (#12952)

parent 202ea6fb
......@@ -81,6 +81,7 @@
"ky-universal": "0.6.0",
"lerna": "3.14.1",
"lint-staged": "10.1.7",
"lost": "8.3.1",
"moment": "^2.24.0",
"node-fetch": "2.6.0",
"node-notifier": "5.4.0",
......@@ -88,6 +89,7 @@
"npm-run-all": "4.1.5",
"nprogress": "0.2.0",
"pixrem": "5.0.0",
"postcss-nested": "4.2.1",
"postcss-pseudoelements": "5.0.0",
"postcss-short-size": "4.0.0",
"postcss-trolling": "0.1.7",
......@@ -103,6 +105,7 @@
"selenium-webdriver": "4.0.0-alpha.5",
"shell-quote": "1.7.2",
"styled-components": "5.1.0",
"styled-jsx-plugin-postcss": "2.0.1",
"tailwindcss": "1.1.3",
"taskr": "1.1.0",
"tree-kill": "1.2.1",
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -59,7 +59,7 @@
},
"dependencies": {
"@ampproject/toolbox-optimizer": "2.3.1",
"@babel/core": "7.9.6",
"@babel/core": "7.7.7",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
"@babel/plugin-proposal-numeric-separator": "7.8.3",
......
console.log('hello from babel!')
module.exports = {
presets: [
[
'next/babel',
{
'styled-jsx': {
plugins: [require.resolve('styled-jsx-plugin-postcss')],
},
},
],
],
}
{
"name": "basic-css",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"lost": "8.2.0",
"next": "latest",
"postcss-nested": "2.1.2",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"styled-jsx-plugin-postcss": "0.1.0"
},
"license": "ISC",
"postcss": {
"plugins": {
"lost": {},
"postcss-nested": {}
}
}
}
export default () => (
<div className="hello">
<p>Hello World</p>
<style jsx>{`
.hello {
font: 15px Helvetica, Arial, sans-serif;
background: #eee;
padding: 100px;
text-align: center;
transition: 100ms ease-in background;
lost-column: 1/3;
&:hover {
color: red;
}
}
.hello:hover {
background: #ccc;
}
`}</style>
</div>
)
/* eslint-env jest */
/* global jasmine */
import { join } from 'path'
import {
killApp,
findPort,
nextStart,
nextBuild,
renderViaHTTP,
} from 'next-test-utils'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 1
const appDir = join(__dirname, '../app')
let appPort
let app
function runTests() {
it('should serve a page correctly', async () => {
const html = await renderViaHTTP(appPort, '/')
expect(html).toContain('Hello World')
})
}
describe('styled-jsx using in node_modules', () => {
describe('production mode', () => {
beforeAll(async () => {
const output = await nextBuild(appDir, undefined, {
stdout: true,
stderr: true,
cwd: appDir,
})
console.log(output.stdout, output.stderr)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(() => killApp(app))
runTests()
})
})
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment