-
Notifications
You must be signed in to change notification settings - Fork 17
/
gulpfile.js
66 lines (58 loc) · 1.74 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat-util'),
sass = require('gulp-sass')(require('sass')),
sourcemaps = require('gulp-sourcemaps');
var kurveSources = [
'./src/window.js',
'./src/Kurve.js',
'./src/KurveStorage.js',
'./src/KurveSound.js',
'./src/KurveTheming.js',
'./src/KurveFactory.js',
'./src/KurveConfig.js',
'./src/KurveUtility.js',
'./src/KurveMenu.js',
'./src/KurveGame.js',
'./src/KurveField.js',
'./src/KurveSuperpowerconfig.js',
'./src/KurveSuperpower.js',
'./src/KurveCurve.js',
'./src/KurvePoint.js',
'./src/KurvePlayer.js',
'./src/KurveLightbox.js',
'./src/KurvePiwik.js',
'./src/KurvePrivacypolicy.js',
];
var kurveLibs = [
'./node_modules/pixi.js/dist/browser/pixi.js',
];
gulp.task('js', function(done) {
gulp.src(kurveLibs.concat(kurveSources))
.pipe(sourcemaps.init())
.pipe(uglify({output: { comments: 'some'}}))
.pipe(concat('kurve.min.js', {sep: ''}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist/js/'))
.on('end', done);
});
gulp.task('sass', function(done) {
gulp.src('./scss/main.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(gulp.dest('./dist/css/'))
.on('end', done);
});
gulp.task('images', function () {
return gulp.src('./images/*').pipe(gulp.dest('./dist/images'));
});
gulp.task('sound', function () {
return gulp.src('./sound/**/*').pipe(gulp.dest('./dist/sound'));
});
gulp.task('build', gulp.series('js', 'sass', 'images', 'sound'));
gulp.task('default', gulp.series('build'));
gulp.task('watch', function() {
gulp.watch([
'src/*',
'scss/*'
], gulp.series('build'))
});