1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Update README.md

This commit is contained in:
Guillermo Rauch 2016-12-24 09:57:15 -08:00 committed by GitHub
parent af2d78c042
commit e81852c742

View file

@ -477,28 +477,7 @@ 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>
)
```
**Note:** Next.js uses Babel 6 out of the box, which doesn't support default `module.exports`. Every time you export a component, make sure you use the ES6 `export` syntax instead.
## Production deployment