-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
91 lines (77 loc) · 1.77 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
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var docUtil = require('amazeui-doc-util');
var runSequence = require('run-sequence');
var tasks = require('amazeui-gulp-tasks');
var config = {
pkg: require('./package.json'),
// release task
ghPages: {
src: 'dist/**/*',
options: {
branch: 'gh-pages'
}
},
// remote branch
git: {
branch: 'master'
},
browserSync: {
notify: false,
server: 'dist',
logPrefix: 'AMP'
},
// watch files and reload browserSync
bsWatches: 'dist/**/*',
// docs:md
md: {
src: ['README.md', 'docs/*.md'],
data: {
pluginTitle: 'Amaze UI Fullpage',
pluginDesc: 'Amaze UI风格的单页滚动效果',
buttons: 'photino/amazeui-fullpage',
head: '<link rel="stylesheet" href="../dist/amazeui.fullpage.min.css"/>'
},
rename: function(file) {
file.basename = file.basename.toLowerCase();
if (file.basename === 'readme') {
file.basename = 'index';
}
file.extname = '.html';
},
dist: function(file) {
if (file.relative === 'index.html') {
return 'dist';
}
return 'docs';
}
},
// compile less
less: {
src: './src/amazeui.fullpage.less',
dist: './dist',
autoPrefixer: {
browsers: ['> 1%', 'IE 9']
},
banner: true
},
// uglify js
uglify: {
src: './src/amazeui.fullpage.js',
dist: './dist',
banner: true
},
// clean path
clean: 'dist'
};
// init tasks
tasks(gulp, config);
gulp.task('copy', function() {
return gulp.src('./src/*.js')
.pipe(gulp.dest('dist'));
});
gulp.task('build', function (callback) {
runSequence('clean', ['copy', 'uglify', 'less', 'markdown'], callback);
});
gulp.task('default', ['build', 'server']);