Commit 200f8eec authored by James O'Dwyer's avatar James O'Dwyer Committed by Arunoda Susiripala

Add warning about module.exports use (#505)

* add warning about module.exports to readme

* rm unnecessary react imports
parent 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment