forked from wechatpivot/wechatpivot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
50 lines (37 loc) · 1.38 KB
/
Copy pathgulpfile.js
File metadata and controls
50 lines (37 loc) · 1.38 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
var gulp = require('gulp');
var shell = require('gulp-shell');
var source = require('vinyl-source-stream');
var exorcist = require('exorcist');
var browserify = require('browserify');
gulp.task('csscopy', function () {
return gulp.src([
'node_modules/bootstrap/dist/css/bootstrap.min.css',
'node_modules/highlight.js/styles/zenburn.css',
])
.pipe(gulp.dest('build/css'));
});
gulp.task('jscs', shell.task(['npm run jscs -s'], { quiet: true, errorMessage: '\n<%= error.stdout %>' }));
gulp.task('jshint', ['jscs'], shell.task(['npm run jshint -s'], { quiet: true, errorMessage: '\n<%= error.stdout %>' }));
gulp.task('jscopy', function () {
return gulp.src([
'node_modules/angular/angular.min.js',
'node_modules/angular/angular.min.js.map',
'node_modules/angular/angular.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/angular-route/angular-route.min.js.map',
'node_modules/angular-route/angular-route.js'
])
.pipe(gulp.dest('build/js'));
});
gulp.task('js', ['jscs', 'jshint'], function () {
var b = browserify({
entries: ['./src/index.js'],
debug: true
});
return b.bundle()
.pipe(exorcist('./build/js/weixin-api-debug.js.map'))
.pipe(source('weixin-api-debug.js'))
.pipe(gulp.dest('./build/js'));
});
gulp.task('default', ['js']);
gulp.task('build', ['csscopy', 'jscopy', 'js']);