-
Notifications
You must be signed in to change notification settings - Fork 17
/
gulpfile.js
executable file
·48 lines (41 loc) · 1.1 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
// Defining base pathes
var basePaths = {
bower: './bower_components/',
src: './src/'
};
// Defining requirements
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var watch = require('gulp-watch');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var ignore = require('gulp-ignore');
var rimraf = require('gulp-rimraf');
// Run:
// gulp watch
// Starts watcher. Watcher runs appropriate tasks on file changes
gulp.task('watch', function () {
gulp.watch('./src/**/*.js', ['build-scripts']);
});
// Run:
// gulp
// Defines gulp default task
gulp.task('default', ['watch'], function () { });
// Run:
// gulp build-scripts.
// Uglifies and concat all JS files into one
gulp.task('build-scripts', function() {
var src = [
basePaths.src + 'smooth-parallax-src.js'
];
// compiled (.js)
gulp.src(src)
.pipe(concat('smooth-parallax.js'))
.pipe(gulp.dest('./dist/'));
// compiled (.min.js)
gulp.src(src)
.pipe(concat('smooth-parallax.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});