Skip to content

Commit e2acfbc

Browse files
committed
2 parents bd6d524 + ff9954d commit e2acfbc

File tree

2 files changed

+53
-21
lines changed

2 files changed

+53
-21
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ It also uses Gulp for running task and TsLint.The seed application is built over
2424
npm run start <= start the Nodemon and watch for changes.
2525
```
2626

27+
## Global packages
28+
```
29+
npm install ts-node -g
30+
npm install typescript-node -g
31+
```
32+
2733
## Directory Structure
2834

2935
```
@@ -51,9 +57,12 @@ angular2-MEAN
5157
│ │ ├── app.component.css
5258
│ │ ├── app.component.ts
5359
│ │ ├── app.html
60+
│ │ ├── app.module.ts
61+
│ │ ├── app.routing.ts
5462
│ │ ├── main.ts
5563
│ ├── typings
5664
│ ├── index.html
65+
│ │ ├── systemjs.config.js
5766
│ ├── tsconfig.json
5867
│ ├── typings.json
5968
├── server
@@ -142,4 +151,4 @@ angular2-MEAN
142151

143152
## License
144153

145-
MIT
154+
MIT

gulpfile.ts

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"use strict";
77

88
const gulp = require("gulp"),
9-
del = require("del"),
10-
tsc = require("gulp-typescript"),
11-
sourcemaps = require('gulp-sourcemaps'),
12-
tsProject = tsc.createProject("tsconfig.json"),
13-
tslint = require('gulp-tslint'),
14-
concat = require('gulp-concat'),
15-
runSequence = require('run-sequence'),
16-
nodemon = require('gulp-nodemon'),
17-
gulpTypings = require("gulp-typings");
9+
del = require("del"),
10+
tsc = require("gulp-typescript"),
11+
sourcemaps = require('gulp-sourcemaps'),
12+
tsProject = tsc.createProject("tsconfig.json"),
13+
tslint = require('gulp-tslint'),
14+
concat = require('gulp-concat'),
15+
runSequence = require('run-sequence'),
16+
nodemon = require('gulp-nodemon'),
17+
gulpTypings = require("gulp-typings");
1818

1919
/**
2020
* Remove build directory.
@@ -89,17 +89,6 @@ gulp.task("libs", () => {
8989
.pipe(gulp.dest("dist/client/libs"));
9090
});
9191

92-
/**
93-
* Watch for changes in TypeScript, HTML and CSS files.
94-
*/
95-
gulp.task('watch', function () {
96-
gulp.watch(["client/**/*.ts"], ['compile']).on('change', function (e) {
97-
console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
98-
});
99-
gulp.watch(["client/**/*.html", "client/**/*.css"], ['clientResources']).on('change', function (e) {
100-
console.log('Resource file ' + e.path + ' has been changed. Updating.');
101-
});
102-
});
10392

10493
/**
10594
* Install typings for server and client.
@@ -135,3 +124,37 @@ gulp.task('start', function () {
135124
gulp.task("build", function (callback) {
136125
runSequence('clean', 'build:server', 'build:client', 'clientResources', 'libs', callback);
137126
});
127+
128+
/**
129+
* Watch for changes in TypeScript, HTML and CSS files.
130+
*/
131+
gulp.task('watch', function () {
132+
gulp.watch(["client/**/*.ts"], ['compile']).on('change', function (e) {
133+
console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
134+
});
135+
gulp.watch(["client/**/*.html", "client/**/*.css"], ['clientResources']).on('change', function (e) {
136+
console.log('Resource file ' + e.path + ' has been changed. Updating.');
137+
});
138+
gulp.watch(["server/src/**/*.ts"], ['compile']).on('change', function (e) {
139+
console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');
140+
});
141+
});
142+
143+
/**
144+
* Build the project.
145+
* 1. Clean the build directory
146+
* 2. Build Express server
147+
* 3. Build the Angular app
148+
* 4. Copy the resources
149+
* 5. Copy the dependencies.
150+
*/
151+
152+
gulp.task("build", function (callback) {
153+
runSequence('clean', 'build:server', 'build:client', 'clientResources', 'libs', callback);
154+
});
155+
156+
157+
gulp.task('default', function() {
158+
runSequence( 'build:server', 'build:client', 'clientResources', 'libs','watch','start');
159+
160+
});

0 commit comments

Comments
 (0)