1 Star 1 Fork 15

jee/LunarCalendar

forked from sinceow/LunarCalendar 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 2.80 KB
一键复制 编辑 原始数据 按行查看 历史
sinceow 提交于 2015-06-25 20:40 . 添加日期切换的过渡动画
var gulp = require("gulp");
var sass = require("gulp-sass");
var minify = require("gulp-minify-css");
var uglify = require("gulp-uglify");
var concat = require("gulp-concat");
var bower = require("gulp-bower");
var watch = require("gulp-watch");
var del = require("del");
var rename = require("gulp-rename");
var plumber = require("gulp-plumber");
var react = require("gulp-react");
var eventstream = require("event-stream");
var browserify = require("gulp-browserify");
var concatcss = require("gulp-concat-css");
var cssurladjuster = require("gulp-css-url-adjuster");
var jasmine = require("gulp-jasmine");
var jasreporter = require("jasmine-reporters");
var mainbowerfiles = require("main-bower-files");
var filter = require("gulp-filter");
var config = {
"js": [
"bower/materialize/dist/js/materialize.js",
"bower/json3/lib/json3.js",
"bower/hammerjs/hammer.js"
],
"css": [
"bower/animate.css/animate.css"
]
};
gulp.task("default", function () {
gulp.start("scss", "js");
gulp.watch(["./sass/*.scss", "./sass/**/*.scss"], ["scss"]);
gulp.watch(["./react/*.js", "./react/**/*.js", "./src/*.js"], ["js"]);
console.log("Watching scss...");
console.log("Watching js...");
});
gulp.task("test", function () {
gulp.src(["./react/__tests__/*.js"])
.pipe(jasmine({
verbose:true,
includeStackTrace: true,
reporter: new jasreporter.TerminalReporter()
}));
});
gulp.task("bower", function(){
bower();
});
gulp.task("scss", function () {
var scss_stream = gulp.src(["./sass/*.scss", "./sass/**/*.scss"])
.pipe(plumber(function (error) {
console.log(error.toString());
this.emit("end");
}))
.pipe(sass())
.pipe(gulp.dest("build"));
var css_stream = gulp.src(config.css);
eventstream.merge(css_stream, scss_stream)
.pipe(concatcss("bundle.css"))
.pipe(cssurladjuster({
replace: ["../fonts/", "../font/"]
})).pipe(cssurladjuster({
replace: ["../../font/", "../font/"]
}))
.pipe(minify())
.pipe(rename("bundle.min.css"))
.pipe(gulp.dest("build"));
});
gulp.task("js", function () {
var react_stream = gulp.src("./react/app.js")
.pipe(plumber(function (error) {
console.log(error.toString());
this.emit("end");
}))
.pipe(browserify({
"transform": [
["reactify", {
"es6": true
}]
]
}))
.pipe(gulp.dest("build"));
var js_stream = gulp.src(config.js);
eventstream.merge(js_stream, react_stream)
.pipe(concat("bundle.js"))
.pipe(gulp.dest("build"))
.pipe(rename("bundle.min.js"))
.pipe(gulp.dest("build"));
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jempson/LunarCalendar.git
git@gitee.com:jempson/LunarCalendar.git
jempson
LunarCalendar
LunarCalendar
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385