-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
98 lines (84 loc) · 2.34 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
89
90
91
92
93
94
95
96
97
98
//--- REQUIRES -----------------------------------------------------------------
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sass = require('gulp-sass')
var minify = require('gulp-minify-css');
var clean = require('gulp-clean');
var ftp = require('gulp-ftp');
//--- PATHS --------------------------------------------------------------------
var paths = {
js_src: './js/src/main.js',
js_dest: './js/',
images_src: ['./img/original/**/*', '!./img/original/**/*.psd'],
images_dest: './img/',
css_src: './css/src/*.scss',
css_dest: './css/',
publish: [ '!./css/src/*',
'!./img/original/**/*',
'!./js/src/*',
'!./bower_components/**/*',
'!./node_modules/**/*',
'!./subl/*',
'!./.gitignore',
'!./package.json',
'!./README.md',
'!./gulpfile.js',
'./**/*',
]
};
//--- TASKS --------------------------------------------------------------------
gulp.task('clean', function () {
return gulp.src(['./img/**/*', '!./img/original/', '!./img/original/**',
'./js/*.js',
'./css/*.css'], {read: false})
.pipe(clean());
});
gulp.task('css', function () {
return gulp.src(paths.css_src)
.pipe(sass())
.pipe(minify({keepBreaks:false}))
.pipe(gulp.dest(paths.css_dest));
});
gulp.task('js', function() {
return gulp.src(paths.js_src)
.pipe(uglify())
.pipe(concat('main.min.js'))
.pipe(gulp.dest(paths.js_dest));
});
gulp.task('img', function() {
return gulp.src(paths.images_src)
.pipe(imagemin({
optimizationLevel: 5,
progressive: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest(paths.images_dest));
});
gulp.task('publish_beta', function () {
gulp.src(paths.publish)
.pipe(ftp({
host: 'ftp.appstronauten.com',
remotePath: '/webseiten/appstronauten/_beta/',
user: '319069-ftp',
pass: '00414739nimpleftp'
}));
});
gulp.task('publish_release', function () {
gulp.src(paths.publish)
.pipe(ftp({
host: 'ftp.appstronauten.com',
remotePath: '/webseiten/appstronauten/',
user: '319069-ftp',
pass: '00414739nimpleftp'
}));
});
gulp.task('watch', function() {
gulp.watch('css/src/*', ['css'], function(event) {
console.log(event.type);
});
gulp.watch('js/src/*', ['js']);
});
gulp.task('default', ['js', 'css', 'img'], function() {
});