1 Star 0 Fork 0

madadimy/konva

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
yawei wang 提交于 2017-04-05 21:37 . update
var gulp = require('gulp'),
clean = require('gulp-clean'),
shell = require('gulp-shell'),
jsdoc = require("gulp-jsdoc"),
webserver = require('gulp-webserver');
// steps
// 1. clean /public folder
// 2. generate new /public with hexo
// 3. replace /public/downloads with /source/downloads
// 4. generate api docs to /public
// 1
gulp.task('clean-public', function(){
return gulp.src('public', {read: false})
.pipe(clean());
});
// 2
gulp.task('generate-hexo', ['clean-public'], shell.task(['node ./node_modules/hexo/bin/hexo generate'], {cwd: './'}));
// 3
gulp.task('clean-public-downloads', ['generate-hexo'], function(){
return gulp.src('public/downloads', {read: false})
.pipe(clean());
});
gulp.task('copy-source-download', ['clean-public-downloads'] ,function() {
return gulp.src('source/downloads/**')
.pipe(gulp.dest('public/downloads'));
});
// 4
gulp.task('docs', ['generate-hexo'], function() {
return gulp.src("konva.js")
.pipe(jsdoc('./public/api', {
"path": "ink-docstrap",
"cleverLinks" : false,
"monospaceLinks" : false,
"dateFormat" : "ddd MMM Do YYYY",
"outputSourceFiles" : true,
"outputSourcePath" : true,
"systemName" : "Konva",
"footer" : "",
"copyright" : "Konva Copyright © 2015 The contributors to the Konva project.",
"navType" : "vertical",
"theme" : "cosmo",
"linenums" : true,
"collapseSymbols" : false,
"inverseNav" : true,
"highlightTutorialCode" : true,
}))
});
gulp.task('server', function() {
gulp.src('public')
.pipe(webserver({}));
});
gulp.task('generate', [
'clean-public',
'generate-hexo',
'clean-public-downloads',
'copy-source-download',
'docs'
]);
gulp.task('default', ['generate', 'server']);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/madadimy/konva.git
git@gitee.com:madadimy/konva.git
madadimy
konva
konva
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385