43 Star 67 Fork 20

ruojianll/AliceSPA

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
ruojianll 提交于 2016-02-09 18:40 . first
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var browserSync = require('browser-sync');
// Compile Our Sass
gulp.task('css', function() {
return gulp.src('client/dev/css/**/*.css')
// .pipe(sass())
.pipe(gulp.dest('client/public/css'));
});
// Concatenate & Minify JS
gulp.task('scripts-lib', function() {
return gulp.src('client/dev/js/lib/**/*.js')
.pipe(concat('client/dev/js/temp/lib.js'))
.pipe(rename('lib.min.js'))
.pipe(gulp.dest('client/public/js/'));
});
gulp.task('scripts', function() {
return gulp.src('client/dev/js/app/**/*.js')
.pipe(concat('client/dev/js/temp/app.js'))
.pipe(rename('app.min.js'))
//.pipe(uglify())
.pipe(gulp.dest('client/public/js/'));
});
gulp.task('template', function() {
var str = gulp.src('client/dev/html/**/*.html')
.pipe(gulp.dest('client/public/'));
return str;
});
gulp.task('data', function() {
var str = gulp.src('client/dev/data/**/*.*')
.pipe(gulp.dest('client/public/data/'));
return str;
});
gulp.task('map', function() {
var str = gulp.src('client/dev/css/**/*.map')
.pipe(gulp.dest('client/public/css/'));
return str;
});
gulp.task('font',function(){
var str = gulp.src('client/dev/fonts/**/*.map')
.pipe(gulp.dest('client/public/fonts/'));
return str;
});
gulp.task('browser-sync', function() {
browserSync.init(["public/css/**/*.css", "public/js/**/*.js","public/**/*.html"], {
server: {
baseDir: "./public/"
}
});
});
// Watch Files For Changes
gulp.task('dev', function() {
gulp.watch('client/dev/js/app/**/*.js', ['scripts']);
gulp.watch('client/dev/js/lib/**/*.js', ['scripts-lib']);
gulp.watch('client/dev/css/**/*.css', ['css']);
gulp.watch('client/dev/html/**/*.html',['template']);
gulp.watch('client/dev/data/**/*.*',['data']);
gulp.watch('client/dev/css/**/*.map',['map']);
gulp.watch('client/dev/fonts/**/*.*',['font']);
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ruojianll/AliceSPA.git
[email protected]:ruojianll/AliceSPA.git
ruojianll
AliceSPA
AliceSPA
master

搜索帮助