-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
59 lines (54 loc) · 1.89 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
var gulp = require('gulp');
var compass = require('gulp-compass');
var webpack = require('gulp-webpack');
gulp.task('mobile_sass', function () {
return gulp.src('./mobile/scss/*.scss')
.pipe(compass({
css: './mobile/styles',
sass: './mobile/scss',
image: './mobile/images',
require: ['compass/import-once/activate'],
style: 'compressed',
sourcemap: true,
task: 'compile'
}))
.pipe(gulp.dest('./mobile/styles'));
});
gulp.task('mobile_webpack', function () {
return gulp.src('./mobile/scripts/src/index.js')
.pipe(webpack({
entry: {
index: './mobile/scripts/src/index.js',
report_detail: './mobile/scripts/src/report_detail.js'
},
output: {
filename: '[name].js'
},
module: {
loaders: [{
test: /\.tpl$/, loader: 'tmodjs'
}, {
test: /\.css$/, loader: 'style!css?minimize&-autoprefixer'
}]
}
}))
.pipe(gulp.dest('./mobile/scripts/dist/'));
});
gulp.task('mobile_module_sass', function () {
return gulp.src('./mobile/tpl/modules/*/*.scss')
.pipe(compass({
css: './mobile/tpl/modules',
sass: './mobile/tpl/modules',
require: ['compass/import-once/activate'],
style: 'compressed',
sourcemap: true,
task: 'compile'
}))
.pipe(gulp.dest('./mobile/tpl/modules'));
});
gulp.task('watch', function () {
gulp.watch('./mobile/scss/*.scss', ['mobile_sass']);
gulp.watch('./mobile/scripts/src/*.js', ['mobile_webpack']);
gulp.watch('./mobile/tpl/modules/*/*.scss', ['mobile_module_sass']);
});
gulp.task('default', ['mobile_sass', 'mobile_webpack', 'mobile_module_sass', 'watch']);