This repository has been archived by the owner on May 18, 2020. It is now read-only.
forked from travist/seamless.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
76 lines (68 loc) · 1.96 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
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var childFiles = [
'src/seamless.base.js',
'src/seamless.connection.js',
'src/seamless.child.js'
];
var parentFiles = [
'src/seamless.base.js',
'src/seamless.connection.js',
'src/seamless.parent.js'
];
gulp.task('lint', function () {
return gulp.src([
'src/seamless.base.js',
'src/seamless.child.js',
'src/seamless.connection.js',
'src/seamless.parent.js'
])
.pipe(eslint({
rules: {
'strict': 2
},
envs: [
'browser'
]
}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('scripts-child', function() {
return gulp.src(['lib/postmessage/postmessage.js'].concat(childFiles))
.pipe(concat('seamless.child.js'))
.pipe(gulp.dest('build/'))
.pipe(rename('seamless.child.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build'));
});
gulp.task('scripts-child-nopm', function() {
return gulp.src(childFiles)
.pipe(concat('seamless.child.nopm.js'))
.pipe(gulp.dest('build/'))
.pipe(rename('seamless.child.nopm.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build'));
});
gulp.task('scripts-parent', function() {
return gulp.src(['lib/postmessage/postmessage.js'].concat(parentFiles))
.pipe(concat('seamless.parent.js'))
.pipe(gulp.dest('build/'))
.pipe(rename('seamless.parent.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build'));
});
gulp.task('scripts-parent-nopm', function() {
return gulp.src(parentFiles)
.pipe(concat('seamless.parent.nopm.js'))
.pipe(gulp.dest('build/'))
.pipe(rename('seamless.parent.nopm.min.js'))
.pipe(uglify())
.pipe(gulp.dest('build'));
});
gulp.task('scripts', ['scripts-child', 'scripts-child-nopm', 'scripts-parent', 'scripts-parent-nopm']);
gulp.task('build', ['lint', 'scripts']);
gulp.task('default', ['build']);