mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Improve custom server typescript example v2 (#4470)
This commit is contained in:
parent
e6f35421a9
commit
0330962618
13
examples/custom-server-typescript/.babelrc
Normal file
13
examples/custom-server-typescript/.babelrc
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"development": {
|
||||||
|
"presets": ["next/babel"]
|
||||||
|
},
|
||||||
|
"production": {
|
||||||
|
"presets": ["next/babel"]
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,19 +2,22 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon server/index.ts",
|
"dev": "nodemon server/index.ts",
|
||||||
"build": "next build && tsc --project tsconfig.server.json",
|
"build": "next build && tsc --project tsconfig.server.json",
|
||||||
"start": "NODE_ENV=production node production-server/index.js"
|
"start": "NODE_ENV=production node .next/production-server/index.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "latest",
|
"@babel/core": "^7.0.0-beta.48",
|
||||||
"react": "^16.2.0",
|
|
||||||
"react-dom": "^16.2.0",
|
|
||||||
"@zeit/next-typescript": "0.1.1",
|
"@zeit/next-typescript": "0.1.1",
|
||||||
"typescript": "^2.7.1"
|
"babel-loader": "^7.1.4",
|
||||||
|
"next": "latest",
|
||||||
|
"react": "^16.4.0",
|
||||||
|
"react-dom": "^16.4.0",
|
||||||
|
"typescript": "latest",
|
||||||
|
"typescript-babel-jest": "^1.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/next": "^2.4.7",
|
"@types/next": "^2.4.11",
|
||||||
"@types/react": "^16.0.36",
|
"@types/react": "^16.0.36",
|
||||||
"nodemon": "^1.12.1",
|
"nodemon": "^1.17.5",
|
||||||
"ts-node": "^4.1.0"
|
"ts-node": "^4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"outDir": "production-server/"
|
"outDir": ".next/production-server/"
|
||||||
},
|
},
|
||||||
"include": ["server/**/*.ts"]
|
"include": ["server/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue