16 Star 53 Fork 19

简单/bookeditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
柴君 提交于 2018-03-17 06:31 . init bookeditor
var gulp = require('gulp'),
sass = require('gulp-sass'),
jshint = require('gulp-jshint'),
mincss = require('gulp-minify-css'),
postcss = require('gulp-postcss'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
connect = require('gulp-connect');
var autoprefixer = require('autoprefixer'),
cssnext = require('cssnext'),
precss = require('precss');
var processors = [
autoprefixer,
cssnext,
precss,
];
gulp.task("dist",function(){
gulp.src("bookeditor.css")
.pipe(postcss(processors))
.pipe(mincss())
.pipe(rename({
dirname: "",
suffix: ".min"
})).pipe(gulp.dest("./"))
gulp.src("bookeditor.js")
.pipe(uglify())
.pipe(rename({
dirname: "",
suffix: ".min"
})).pipe(gulp.dest("./"));
});
gulp.task("build", function(){
gulp.src("src/bookeditor.scss")
.pipe(sass())
.pipe(gulp.dest("./"))
.pipe(connect.reload());
gulp.src("src/bookeditor.js")
.pipe(jshint())
.pipe(jshint.reporter("default"))
.pipe(gulp.dest("./"))
.pipe(connect.reload());
});
gulp.task("connect", function(){
connect.server({
host: "0.0.0.0",
livereload: true
});
});
gulp.task("default", ["build", "connect"], function(){
gulp.watch("src/**/*.scss", ["build"]);
gulp.watch("src/**/*.js", ["build"]);
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/beibq/bookeditor.git
[email protected]:beibq/bookeditor.git
beibq
bookeditor
bookeditor
master

搜索帮助