Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
feat(build): add config for universal watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wiles committed Dec 30, 2018
1 parent d286347 commit 79347d6
Show file tree
Hide file tree
Showing 6 changed files with 1,906 additions and 999 deletions.
94 changes: 22 additions & 72 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
"root": "",
"projectType": "application",
"architect": {
"watch": {
"builder": "@nguniversal/builders:ssr",
"options": {
"browserTarget": "ng-universal-demo:build",
"universalTarget": "ng-universal-demo:server",
"ssrExecuteTarget": "ng-universal-demo:serverExecute"
}
},
"serverBuild": {
"builder": "@nrwl/builders:node-build",
"options": {
"main": "server.ts",
"tsConfig": "tsconfig.json",
"outputPath": "dist"
}
},
"serverExecute": {
"builder": "@nrwl/builders:node-execute",
"options": {
"buildTarget": "ng-universal-demo:serverBuild"
}
},
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
Expand All @@ -31,78 +53,6 @@
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ng-universal-demo:build"
},
"configurations": {
"production": {
"browserTarget": "ng-universal-demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ng-universal-demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"src/styles.css"
],
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
},
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
}
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"server": {
Expand Down
Binary file added nguniversal-builders-0.1.0.tgz
Binary file not shown.
39 changes: 21 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,39 @@
"pre-commit": [],
"private": true,
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/platform-server": "^6.0.0",
"@angular/router": "^6.0.0",
"@nguniversal/common": "^6.0.0",
"@nguniversal/express-engine": "^6.0.0",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"@angular/animations": "~7.1.4",
"@angular/common": "~7.1.4",
"@angular/compiler": "~7.1.4",
"@angular/core": "~7.1.4",
"@angular/forms": "~7.1.4",
"@angular/http": "~7.1.4",
"@angular/platform-browser": "~7.1.4",
"@angular/platform-browser-dynamic": "~7.1.4",
"@angular/platform-server": "~7.1.4",
"@angular/router": "~7.1.4",
"@nguniversal/common": "~7.0.2",
"@nguniversal/express-engine": "~7.0.2",
"@nguniversal/module-map-ngfactory-loader": "~7.0.2",
"@nguniversal/builders": "file:./nguniversal-builders-0.1.0.tgz",
"@nrwl/builders": "^7.1.1",
"core-js": "^2.4.1",
"express": "^4.15.2",
"reflect-metadata": "^0.1.10",
"rxjs": "^6.2.2",
"tslib": "^1.9.3",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.6.0",
"@angular/cli": "6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@angular-devkit/build-angular": "0.11.4",
"@angular/cli": "~7.1.4",
"@angular/compiler-cli": "~7.1.4",
"@angular/language-service": "~7.1.4",
"@types/node": "^8.0.30",
"codelyzer": "^4.0.2",
"http-server": "^0.10.0",
"pre-commit": "^1.2.2",
"ts-loader": "^4.2.0",
"tslint": "^5.7.0",
"typescript": "~2.7.2"
"typescript": "~3.1.1"
}
}
2 changes: 1 addition & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const PORT = process.env.PORT || 4000;
const DIST_FOLDER = join(process.cwd(), 'dist');

// * NOTE :: leave this as require() since this file is built Dynamically from webpack
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./server/main');
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./dist/server/main');

// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
app.engine('html', ngExpressEngine({
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: `
<h1>Universal Demo using Angular and Angular CLI</h1>
<h1>Universal Demo using Angular and Angular CLI helllll my name is jack</h1>
<a routerLink="/">Home</a>
<a routerLink="/lazy">Lazy</a>
<a routerLink="/lazy/nested">Lazy_Nested</a>
Expand Down
Loading

0 comments on commit 79347d6

Please sign in to comment.