1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
This commit is contained in:
nkzawa 2016-10-25 22:52:51 +09:00
commit a0d94ce076
2 changed files with 9 additions and 22 deletions

View file

@ -1,4 +1,4 @@
# next.js
<img width="112" alt="screen shot 2016-10-25 at 2 37 27 pm" src="https://cloud.githubusercontent.com/assets/13041/19686250/971bf7f8-9ac0-11e6-975c-188defd82df1.png">
Next.js is a minimalistic framework for server-rendered React applications.
@ -50,7 +50,7 @@ We use [glamor](https://github.com/threepointone/glamor) to provide a great buil
```jsx
import React from 'react'
import style from 'next/css'
import css from 'next/css'
export default () => (
<div className={style}>
@ -58,15 +58,13 @@ export default () => (
</div>
)
const style = style({
main: {
background: 'red',
':hover': {
background: 'gray'
}
'@media (max-width: 600px)': {
background: 'blue'
}
const style = css({
background: 'red',
':hover': {
background: 'gray'
},
'@media (max-width: 600px)': {
background: 'blue'
}
})
```

View file

@ -1,5 +1,4 @@
#!/usr/bin/env node
import { exec } from 'child_process'
import { resolve, join } from 'path'
import parseArgs from 'minimist'
import { exists } from 'mz/fs'
@ -17,12 +16,6 @@ const argv = parseArgs(process.argv.slice(2), {
}
})
const open = url => {
const openers = { darwin: 'open', win32: 'start' }
const cmdName = openers[process.platform] || 'xdg-open'
exec(`${cmdName} ${url}`)
}
const dir = resolve(argv._[0] || '.')
clean(dir)
@ -39,10 +32,6 @@ clean(dir)
console.warn('> Couldn\'t find a `pages` directory. Please create one under the project root')
}
}
if (!/^(false|0)$/i.test(process.env.NEXT_OPEN_BROWSER)) {
open(`http://localhost:${argv.port}`)
}
})
.catch((err) => {
console.error(err)