This repository has been archived by the owner on Jul 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
77 lines (63 loc) · 2.7 KB
/
Gulpfile.js
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
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
//----------------------------------------------------------------------------------------------------------------------
// JS
//----------------------------------------------------------------------------------------------------------------------
gulp.task('js', ['templates'], function () {
gulp.src([
'./bower_components/jquery/dist/jquery.min.js',
'./bower_components/angular/angular.min.js',
'./bower_components/angular-cookies/angular-cookies.min.js',
'./bower_components/lodash/lodash.min.js',
'./tmp/templates.js',
'./src/app/**/*.js',
'!./src/app/**/*.spec.js'
])
.pipe(plugins.order([
'**/jquery/**',
'**/angular/**',
'bower_components/**/*',
'src/app/**/*.module.js',
'tmp/templates.js',
'src/app/**/*.js'
], {base: './'}))
.pipe(plugins.concat('app.js'))
.pipe(gulp.dest('./dist/static/js'));
});
//----------------------------------------------------------------------------------------------------------------------
// SCSS
//----------------------------------------------------------------------------------------------------------------------
gulp.task('scss', function () {
gulp.src('./src/scss/styles.scss')
.pipe(plugins.sass().on('error', plugins.sass.logError))
.pipe(gulp.dest('./dist/static/css'));
});
gulp.task('scss:watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
});
//----------------------------------------------------------------------------------------------------------------------
// HTML
//----------------------------------------------------------------------------------------------------------------------
gulp.task('copyIndexPage', function () {
gulp.src('./src/index.html')
.pipe(gulp.dest('./dist'));
});
gulp.task('templates', function () {
gulp.src('src/app/**/*.html')
.pipe(plugins.angularTemplatecache('templates.js'))
.pipe(gulp.dest('tmp'));
});
//----------------------------------------------------------------------------------------------------------------------
// Resources
//----------------------------------------------------------------------------------------------------------------------
gulp.task('copyImages', function () {
});
//----------------------------------------------------------------------------------------------------------------------
// Default tasks
//----------------------------------------------------------------------------------------------------------------------
gulp.task('default', [
'js',
'scss',
'copyIndexPage'
]);