Skip to content

Instantly share code, notes, and snippets.

@anthanh
Last active December 12, 2017 23:23
Show Gist options
  • Save anthanh/1f8bff715e343482300fe21a76ccf992 to your computer and use it in GitHub Desktop.
Save anthanh/1f8bff715e343482300fe21a76ccf992 to your computer and use it in GitHub Desktop.
Angular 5 with Universal and TransferState: tsconfig.server.json & angular-cli.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "commonjs",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts",
"server.ts"
],
"angularCompilerOptions": {
"entryModule": "app/app.server.module#AppServerModule"
}
}
{
...
"exclude": [
"test.ts",
"**/*.spec.ts",
"server.ts"
]
}
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "angular-universal-example"
},
"apps": [{
"root": "src",
"outDir": "dist/browser",
...
},
{
"root": "src",
"outDir": "dist/server",
"assets": [],
"platform": "server",
"index": "index.html",
"main": "main.server.ts",
"test": "test.ts",
"tsconfig": "tsconfig.server.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment