代码拉取完成,页面将自动刷新
同步操作将从 taozhiwei/AdminLTE2-itcast 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* eslint-disable */
'use strict';
const gulp = require('gulp');
const del = require('del');
const htmlbeautify = require('gulp-html-beautify');
const extender = require('gulp-html-extend');
var htmlmin = require('gulp-htmlmin');
// 清理加工数据文件
gulp.task('del', function () {
return del([
'./release/bower_components',
'./release/components',
'./release/assets',
'./release/pages',
'./release/modules',
'./release/plugins',
'./release/pkg',
'./release/dist/pages/*-tab-*'
])
.then(paths => {
console.log('Deleted files and folders:\n', paths.join('\n'));
})
.catch(err =>{
console.error('Error from Deleted compress task', err.toString());
});
});
// layout编译
gulp.task('layout', function () {
var stream = gulp.src('./release/dist/pages/single/*.html')
.pipe(extender({annotations:false,verbose:false})) // default options
.pipe(gulp.dest('./release/dist/pages/all-in-one'));
return stream;
});
// 美化代码
function createErrorHandler(name) {
return function (err) {
console.error('Error from ' + name + ' in compress task', err.toString());
};
}
// 输出html美化
var options = {
"indent_size": 4,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 4,
"end_with_newline": false
};
gulp.task('htmlbeautify', function () {
var stream = gulp.src('./release/dist/pages/*.html')
.on('error', createErrorHandler('gulp.src'))
.pipe(htmlbeautify(options))
.on('error', createErrorHandler('htmlbeautify'))
.pipe(htmlmin({}))
.pipe(gulp.dest('./release/dist/pages'))
.on('error', createErrorHandler('gulp.dest'));
return stream;
});
gulp.task('htmlbeautify2', function () {
var stream = gulp.src('./release/dist/pages/all-in-one/*.html')
.on('error', createErrorHandler('gulp.src'))
.pipe(htmlbeautify(options))
.on('error', createErrorHandler('htmlbeautify'))
.pipe(htmlmin({}))
.pipe(gulp.dest('./release/dist/pages/all-in-one'))
.on('error', createErrorHandler('gulp.dest'));
return stream;
});
// 复制文件到发布目录
gulp.task('cp', function () {
var stream = gulp.src('./plugins/**/*.*')
.pipe(gulp.dest('./release/dist/plugins'));
return stream;
});
gulp.task('default',function(){});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。