1 Star 0 Fork 0

大嘴吃油条/cme-imageUpload

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
大嘴吃油条 提交于 2018-06-06 15:44 . init
var gulp = require('gulp'),
connect = require('gulp-connect'),
babel = require('gulp-babel'),
clean = require('gulp-clean'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
minifyCSS = require('gulp-minify-css'),
autoprefixer = require('gulp-autoprefixer');
gulp.task('reloadfile',function(){
gulp.src('src/**/*.*')
.pipe(connect.reload());
});
gulp.task('minjs',()=>{
var stream = gulp.src('src/*.js')
.pipe(babel({
presets:['es2015']
}))
.pipe(concat('jquery.cme-uploadImage.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist/js'));
return stream;
});
gulp.task('js',()=>{
var stream = gulp.src('src/*.js')
.pipe(babel({
presets:['es2015']
}))
.pipe(concat('jquery.cme-uploadImage.js'))
.pipe(gulp.dest('dist/js'));
return stream;
});
gulp.task('minCss',()=>{
var stream = gulp.src('src/css/*.css')
.pipe(minifyCSS())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('dist/css'));
return stream;
});
gulp.task('css',()=>{
var stream = gulp.src('src/css/*.css')
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest('dist/css'));
return stream;
});
gulp.task('clean',()=>{
var stream = gulp.src('dist')
.pipe(clean());
return stream;
});
gulp.task('connect',function(){
connect.server({
livereload: true,
port: 8000
});
});
gulp.task('watch',function(){
gulp.watch('src/**/*.*',['dev']);
});
gulp.task('dev',['clean'],()=>{
gulp.start('js','css','reloadfile');
});
gulp.task('default',['connect','clean'],()=>{
gulp.start('js','css','watch');
});
gulp.task('release',['clean'],()=>{
gulp.start('minjs','minCss');
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/bigmouth/cme-imageUpload.git
git@gitee.com:bigmouth/cme-imageUpload.git
bigmouth
cme-imageUpload
cme-imageUpload
master

搜索帮助