This repository was archived by the owner on Oct 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgulpfile.js
More file actions
78 lines (65 loc) · 1.9 KB
/
gulpfile.js
File metadata and controls
78 lines (65 loc) · 1.9 KB
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
var gulp = require('gulp');
var markdown = require('gulp-markdown');
var sass = require('gulp-sass');
var imagemin = require('gulp-imagemin');
var concat = require('gulp-concat');
var runSequence = require('run-sequence');
var mustache = require("gulp-mustache");
var config = {
dist: './dist',
assets: './assets'
}
// ### Clean
// `gulp clean` - Deletes the build folder entirely.
gulp.task('clean', require('del').bind(null, ['./dist']));
// ### Styles
// `gulp styles` - Compiles, combines, and optimizes Bower CSS and project CSS.
gulp.task('styles', function() {
return gulp.src(config.assets + '/styles/main.scss')
.pipe(sass())
.pipe(gulp.dest(config.dist + '/css'));
});
// Scripts
gulp.task("scripts", function(){
return gulp.src([
'./node_modules/bootstrap/dist/js/bootstrap.js.map',
'./node_modules/bootstrap/dist/js/bootstrap.js',
config.assets + '/scripts/*.js'
])
.pipe(gulp.dest(config.dist + '/scripts'))
});
// Fonts
gulp.task('fonts', function() {
return gulp.src(config.assets + '/fonts/**.*')
.pipe(gulp.dest(config.dist + '/fonts'));
});
// Images
gulp.task('images', function() {
return gulp.src(config.assets + '/images/**.*')
.pipe(imagemin({
progressive: true,
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}, {cleanupIDs: false}]
}))
.pipe(gulp.dest(config.dist + '/images'))
});
gulp.task('docs', function () {
return gulp.src(config.assets + '/templates/*.mustache')
.pipe(mustache(config.assets + '/json/documentation.json',{extension: '.php'},{}))
.pipe(gulp.dest(config.dist + '/docs'));
});
//Build task
gulp.task('build', function(callback) {
runSequence('clean',
'styles',
'scripts',
'fonts',
'images',
'docs',
callback);
});
// ### Gulp
// `gulp` - Run a complete build. To compile for production run `gulp --production`.
gulp.task('default', function() {
gulp.start('build');
});