forked from drewnoakes/fix-decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (48 loc) · 1.37 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
// Include gulp
var gulp = require('gulp');
// Include plugins dependencies
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
// Copy internal js files
gulp.task('app', function() {
return gulp.src('src/scripts/app/*.js')
.pipe(gulp.dest('dist/scripts/app'))
});
// Copy external js files which are already minified
gulp.task('lib', function() {
return gulp.src(
[
'node_modules/jquery/dist/jquery.min.js',
'node_modules/lodash/lodash.min.js',
'node_modules/handlebars/dist/handlebars.min.js'
])
.pipe(gulp.dest('dist/scripts/lib'))
});
// Copy & minify external js files which are not already minified
gulp.task('lib-min', function() {
return gulp.src(
[
'node_modules/requirejs/require.js',
])
.pipe(uglify())
.pipe(rename(function (path) {
path.extname = '.min.js';
}))
.pipe(gulp.dest('dist/scripts/lib'))
});
// Copy styles.css file
gulp.task('styles', function() {
return gulp.src('src/styles/styles.css')
.pipe(gulp.dest('dist/styles'))
});
// Copy index.html file
gulp.task('index', function() {
return gulp.src('src/index.html')
.pipe(gulp.dest('dist'));
});
// Copy github-icon.png file
gulp.task('img', function() {
return gulp.src('src/img/github-icon.png')
.pipe(gulp.dest('dist/img'))
});
gulp.task('default', gulp.parallel('app', 'lib', 'lib-min', 'styles', 'index', 'img'));