-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathgulpfile.js
More file actions
78 lines (70 loc) · 1.79 KB
/
gulpfile.js
File metadata and controls
78 lines (70 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
var gulp = require('gulp');
var concat = require('gulp-concat');
var watch = require('gulp-watch');
var connect = require('gulp-connect');
var ngTemplates = require('gulp-ng-templates');
var sourcemaps = require('gulp-sourcemaps');
var headerfooter = require('gulp-headerfooter');
gulp.task('default', [
'build','deps',
'html', 'style',
'connect', 'templates'
], function() {
gulp.watch([
'./app/**/*.js',
'./app/**/*.html',
'./views/index.html',
'./lib/*.js'
], ['build', 'html', 'templates', 'deps']);
});
gulp.task('deps', function() {
return gulp.src([
'node_modules/@angular/router/angular1/angular_1_router.js'
])
.pipe(sourcemaps.init())
.pipe(concat('dependencies.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dist/'));
});
gulp.task('build', function() {
return gulp.src([
'./app/**/*.js'
])
.pipe(sourcemaps.init())
.pipe(concat('bundle.js'))
//.pipe(headerfooter.header("(function() {\n"))
//.pipe(headerfooter.footer("}());\n"))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dist/'));
});
gulp.task('html', function() {
return gulp.src([
'./views/index.html'
])
.pipe(gulp.dest('./dist/'));
});
gulp.task('style', function() {
return gulp.src([
'node_modules/bootstrap/dist/css/bootstrap.css'
])
.pipe(gulp.dest('./dist/'));
});
gulp.task('connect', function() {
connect.server({
root: 'dist',
port: 8080
});
});
gulp.task('templates', function () {
return gulp.src([
'app/**/**.html'
])
.pipe(ngTemplates({
filename: 'templates.js',
module: 'app.templates',
path: function (path, base) {
return path.replace(base, '');
}
}))
.pipe(gulp.dest('./dist/'));
});