diff --git a/README.md b/README.md index fb4fe0d8d653bc768ba28dcf20531e5ad2e6b796..e64b550f36b40dd97dbbbb6f16ca41674564acbf 100644 --- a/README.md +++ b/README.md @@ -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 = () => ( + Invalid +) +``` +##### Valid: +```js +// good import +import Link from 'next/link'; + +// good export +export default () => ( + Valid +) +``` + ## Production deployment To deploy, instead of running `next`, you probably want to build ahead of time. Therefore, building and starting are separate commands: