Skip to content

Commit f19c1ad

Browse files
authored
Merge pull request #51 from albertpak/master
Adding in livereload option for webserver
2 parents ae118dc + d2089e6 commit f19c1ad

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://secure.travis-ci.org/swirlycheetah/generator-angular2.png?branch=master)](https://travis-ci.org/swirlycheetah/generator-angular2) [![Join the chat at https://gitter.im/swirlycheetah/generator-angular2](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/swirlycheetah/generator-angular2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44

5-
A [Yeoman](http://yeoman.io) Generator to aid in bootstrapping an Angular2 application using the very latest Angular2 alpha release.
5+
A [Yeoman](http://yeoman.io) Generator to aid in bootstrapping an Angular2 application using the very latest Angular2 Beta release.
66

77
### Getting Started
88

@@ -22,6 +22,12 @@ You'll be prompted to start the server once the generator has finished.
2222

2323
You'll then be able to access the application at `http://localhost:8000`. Serving the application can be configured in the `gulpfile.js` using [gulp-webserver](https://www.npmjs.com/package/gulp-webserver) options.
2424

25+
To run this server, execute this command in your terminal:
26+
27+
```bash
28+
gulp dev
29+
```
30+
2531
### Generated Structure
2632

2733
The structure generated is;
@@ -32,7 +38,7 @@ The structure generated is;
3238
- index.html
3339
- {generated-file-name}.js
3440
- {generated-file-name}.html
35-
- .editorconfig
41+
- .editorconfig
3642
- .gitignore
3743
- gulpfile.js
3844
- package.json

app/templates/_gulpfile.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ gulp.task('dev', ['watch', 'serve']);
1313
gulp.task('serve', function () {
1414
gulp.src('build')
1515
.pipe(webserver({
16-
open: true
16+
livereload: true,
17+
open: true,
1718
}));
1819
});
1920

@@ -35,7 +36,7 @@ gulp.task('dependencies', function () {
3536
'node_modules/angular2/bundles/angular2-polyfills.js',
3637
'node_modules/rxjs/bundles/Rx.js',
3738
'node_modules/es6-shim/es6-shim.min.js',
38-
'node_modules/es6-shim/es6-shim.map'
39+
'node_modules/es6-shim/es6-shim.map',
3940
])
4041
.pipe(gulp.dest('build/lib'));
4142
});
@@ -44,29 +45,29 @@ gulp.task('dependencies', function () {
4445
gulp.task('js', function () {
4546
return gulp.src('src/**/*.js')
4647
.pipe(rename({
47-
extname: ''
48+
extname: '',
4849
}))
4950
.pipe(traceur({
5051
modules: 'instantiate',
5152
moduleName: true,
5253
annotations: true,
5354
types: true,
54-
memberVariables: true
55+
memberVariables: true,
5556
}))
5657
.pipe(rename({
57-
extname: '.js'
58+
extname: '.js',
5859
}))
5960
.pipe(gulp.dest('build'));
6061
});
6162

6263
// move html
6364
gulp.task('html', function () {
6465
return gulp.src('src/**/*.html')
65-
.pipe(gulp.dest('build'))
66+
.pipe(gulp.dest('build'));
6667
});
6768

6869
// move css
6970
gulp.task('css', function () {
7071
return gulp.src('src/**/*.css')
71-
.pipe(gulp.dest('build'))
72+
.pipe(gulp.dest('build'));
7273
});

0 commit comments

Comments
 (0)