Skip to content

Commit ac9d3c7

Browse files
committed
Add Zeit Next.js Installation documentation
1 parent 7a378c8 commit ac9d3c7

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.docz/app/db.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@
104104
}
105105
]
106106
}
107+
},
108+
{
109+
"key": "src/pages/installation/zeit-next-js.mdx",
110+
"value": {
111+
"name": "Zeit Next.js",
112+
"route": "/installation/zeit-next-js",
113+
"menu": "Installation",
114+
"id": "aa24e7b540a30970bc1e16d589856ee5",
115+
"filepath": "src/pages/installation/zeit-next-js.mdx",
116+
"link": "https://github.com/AryanJ-NYC/reactandtypescript.dev/edit/master/src/pages/installation/zeit-next-js.mdx",
117+
"slug": "src-pages-installation-zeit-next-js",
118+
"headings": [
119+
{
120+
"slug": "zeit-nextjs",
121+
"depth": 1,
122+
"value": "Zeit Next.js"
123+
}
124+
]
125+
}
107126
}
108127
]
109128
}

.docz/app/imports.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ export const imports = {
1111
import(
1212
/* webpackPrefetch: true, webpackChunkName: "src-pages-installation-create-react-app" */ 'src/pages/installation/create-react-app.mdx'
1313
),
14+
'src/pages/installation/zeit-next-js.mdx': () =>
15+
import(
16+
/* webpackPrefetch: true, webpackChunkName: "src-pages-installation-zeit-next-js" */ 'src/pages/installation/zeit-next-js.mdx'
17+
),
1418
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: Zeit Next.js
3+
route: /installation/zeit-next-js
4+
menu: Installation
5+
---
6+
7+
# Zeit Next.js
8+
9+
For additional details, please refer to [Next.js + Typescript documentation](https://github.com/zeit/next-plugins/tree/master/packages/next-typescript).
10+
11+
1\. In an existing, Zeit.js project, install `@zeit/next-typescript`:
12+
13+
```
14+
npm install --save @zeit/next-typescript
15+
```
16+
17+
or
18+
19+
```
20+
yarn add @zeit/next-typescript
21+
```
22+
23+
2\. Create or edit `next.config.js`:
24+
25+
```js
26+
// new next.config.js
27+
const withTypescript = require('@zeit/next-typescript');
28+
module.exports = withTypescript();
29+
```
30+
31+
or
32+
33+
```js
34+
// existing next.config.js
35+
const withTypescript = require('@zeit/next-typescript');
36+
module.exports = withTypescript({
37+
webpack(config, options) {
38+
return config;
39+
},
40+
});
41+
```
42+
43+
3\. Create or edit `.babelrc`:
44+
45+
```json
46+
{
47+
"presets": ["next/babel", "@zeit/next-typescript/babel"]
48+
}
49+
```
50+
51+
4\. Create a [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) in the root of your project:
52+
53+
```json
54+
{
55+
"compilerOptions": {
56+
"allowJs": true,
57+
"allowSyntheticDefaultImports": true,
58+
"jsx": "preserve",
59+
"lib": ["dom", "es2017"],
60+
"module": "esnext",
61+
"moduleResolution": "node",
62+
"noEmit": true,
63+
"noUnusedLocals": true,
64+
"noUnusedParameters": true,
65+
"preserveConstEnums": true,
66+
"removeComments": false,
67+
"skipLibCheck": true,
68+
"sourceMap": true,
69+
"strict": true,
70+
"target": "esnext"
71+
}
72+
}
73+
```

0 commit comments

Comments
 (0)