代码拉取完成,页面将自动刷新
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"]);
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。