We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0704af3 commit 88de294Copy full SHA for 88de294
gulpfile.js
@@ -1,4 +1,5 @@
1
var gulp = require('gulp');
2
+var browserSync = require('browser-sync').create();
3
$ = require('gulp-load-plugins')();
4
5
gulp.task('clean', function () {
@@ -11,7 +12,7 @@ gulp.task('copy', ['clean'], function () {
11
12
.pipe(gulp.dest('dist/.'));
13
});
14
-gulp.task('usemin', ['copy'], function () {
15
+gulp.task('dist', ['copy'], function () {
16
return gulp.src('app/index.html')
17
.pipe($.usemin({
18
css: [$.cleanCss(), $.rev()],
@@ -20,5 +21,15 @@ gulp.task('usemin', ['copy'], function () {
20
21
.pipe(gulp.dest('dist/'));
22
23
24
+gulp.task('serve', function() {
25
+
26
+ browserSync.init({
27
+ server: './app'
28
+ });
29
30
+ gulp.watch(['app/**/*.js', 'app/**/*.css', 'app/**/*.html'])
31
+ .on('change', browserSync.reload);
32
+});
33
34
// Tell Gulp what to do when we type "gulp" into the terminal
-gulp.task('default', ['usemin']);
35
+gulp.task('default', ['serve']);
package.json
@@ -7,6 +7,7 @@
7
"license": "MIT",
8
"devDependencies": {
9
"bower": "^1.7.7",
10
+ "browser-sync": "~2.15.0",
"gulp": "~3.9.1",
"gulp-clean": "~0.3.2",
"gulp-concat": "~2.6.0",
0 commit comments