1 Star 0 Fork 20

zhangsongfu/Linger

forked from loveyu/Linger 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Gulpfile.js 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
loveyu 提交于 2015-07-25 17:09 . 添加后台菜单控制
var gulp = require('gulp'),
minifyCss = require('gulp-minify-css'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
htmlMin = require('gulp-htmlmin'),
fs = require('fs'),
child_process = require('child_process');
/**
* Vue 的数据压缩
*/
gulp.task("vue_mini_js", function () {
child_process.execSync("php make_vue_script.php");
var path = 'web_resource/vue/';
if (fs.existsSync(path + "dist.min.js")) {
fs.unlinkSync(path + 'dist.min.js');
}
return gulp.src(path + 'dist.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(path));
});
/**
* Vue JS 输出
*/
gulp.task("vue_js", ['vue_mini_js'], function () {
gulp.src([
'web_resource/director/director.min.js',
'web_resource/vue/vue.min.js',
'web_resource/vue/dist.min.js'
]).pipe(concat('vue.min.js'))
.pipe(gulp.dest('web/style/default/'));
gulp.src([
'web_resource/director/director.js',
'web_resource/vue/vue.js',
'web_resource/vue/dist.js'
]).pipe(concat('vue.js'))
.pipe(gulp.dest('web/style/default/'));
});
gulp.task('admin_v2_plugin_js', function () {
var list = [
'fastclick/fastclick.js',
'sparkline/jquery.sparkline.js',
'jvectormap/jquery-jvectormap-1.2.2.min.js',
'jvectormap/jquery-jvectormap-world-mill-en.js',
'slimScroll/jquery.slimscroll.js',
'chartjs/Chart.js'
];
for (var i = 0; i < list.length; i++) {
list[i] = "bower_components/admin-lte/plugins/" + list[i];
}
return gulp.src(list)
.pipe(concat('plugin.js'))
.pipe(gulp.dest('web/style/default/admin-v2'))
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('web/style/default/admin-v2'));
});
gulp.task('admin_v2_plugin_css', function () {
var list = [
'jvectormap/jquery-jvectormap-1.2.2.css'
];
for (var i = 0; i < list.length; i++) {
list[i] = "bower_components/admin-lte/plugins/" + list[i];
}
return gulp.src(list)
.pipe(concat('plugin.css'))
.pipe(gulp.dest('web/style/default/admin-v2'))
.pipe(minifyCss())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('web/style/default/admin-v2'));
});
gulp.task('admin_v2_plugin', ['admin_v2_plugin_css', 'admin_v2_plugin_js']);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/dandingboshi/Linger.git
git@gitee.com:dandingboshi/Linger.git
dandingboshi
Linger
Linger
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385