提交 200f8eec 编写于 作者: J James O'Dwyer 提交者: Arunoda Susiripala

Add warning about module.exports use (#505)

* add warning about module.exports to readme

* rm unnecessary react imports
上级 b9f87531
......@@ -477,6 +477,29 @@ module.exports = {
}
```
#### Default Babel configuration
Next.js uses Babel6 out of the box, which doesn't support default `module.exports`.
##### Invalid:
```js
// bad import
const Link = require('next/link').default;
// bad export
module.exports = () => (
<Link href='/'>Invalid</Link>
)
```
##### Valid:
```js
// good import
import Link from 'next/link';
// good export
export default () => (
<Link href='/'>Valid</Link>
)
```
## Production deployment
To deploy, instead of running `next`, you probably want to build ahead of time. Therefore, building and starting are separate commands:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册