-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
88 lines (77 loc) · 1.95 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
78
79
80
81
82
83
84
85
86
87
88
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var del = require('del');
var runSequence = require('run-sequence');
var babel = require('gulp-babel');
var assign = Object.assign || require('object.assign');
var paths = {
root: 'src',
source: 'src/**/*.js',
html: 'src/**/*.html',
style: 'styles/**/*.css',
sass: 'scss/**/*.scss',
output: 'dist/',
doc:'./doc'
};
var compilerOptions = {
filename: '',
filenameRelative: '',
blacklist: [],
whitelist: [],
modules: '',
sourceMap: true,
sourceMapName: '',
sourceRoot: '',
moduleRoot: 'symphony',
moduleIds: false,
experimental: false,
format: {
comments: false,
compact: false,
indent: {
parentheses: true,
adjustMultilineComment: true,
style: " ",
base: 0
}
}
};
gulp.task('clean', function(cb) {
del([paths.output], cb);
});
gulp.task('lint', function() {
return gulp.src(paths.source)
.pipe(jshint());
});
gulp.task('build-es6', function () {
return gulp.src(paths.source)
.pipe(gulp.dest(paths.output + 'es6'));
});
gulp.task('build-commonjs', function () {
return gulp.src(paths.source)
.pipe(babel(assign({}, compilerOptions, {modules:'common'})))
.pipe(gulp.dest(paths.output + 'commonjs'));
});
gulp.task('build-amd', function () {
return gulp.src(paths.source)
.pipe(babel(assign({}, compilerOptions, {modules:'amd'})))
.pipe(gulp.dest(paths.output + 'amd'));
});
gulp.task('build-system', function () {
return gulp.src(paths.source)
.pipe(babel(assign({}, compilerOptions, {modules:'system'})))
.pipe(gulp.dest(paths.output + 'system'));
});
gulp.task('build-ignore', function () {
return gulp.src(paths.source)
.pipe(babel(assign({}, compilerOptions, {modules:'ignore'})))
.pipe(gulp.dest(paths.output));
});
gulp.task('build', function(callback) {
return runSequence(
'clean',
'build-ignore',
callback
);
});
gulp.task('default', ['clean', 'lint', 'build']);