代码拉取完成,页面将自动刷新
同步操作将从 Gerald/h5player 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!node
var gulp = require('gulp');
var concat = require('gulp-concat');
var merge2 = require('merge2');
var uglify = require('gulp-uglify');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var css2js = require('gulp-css2js');
var rename = require('gulp-rename');
var wrap = require('gulp-wrap');
var clone = require('gulp-clone');
var header = require('gulp-header');
var autoprefixer = require('gulp-autoprefixer');
var pkg = require('./package.json');
var banner = [
'/**',
' * <%= pkg.title %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @license <%= pkg.license %>',
' * @author <%= pkg.author %>',
' */',
'',
].join('\n');
var assets_js;
var assets_css;
gulp.task('build-js', function () {
var stream = gulp.src('src/*.js')
.pipe(concat('player.js'))
.pipe(wrap('(function(){\n<%=contents%>\n}).call({});'))
.pipe(uglify())
.pipe(header(banner, {pkg: pkg}))
.pipe(rename({suffix:'.min'}));
assets_js = stream.pipe(clone());
return stream.pipe(gulp.dest('dist/'))
});
gulp.task('build-css', function () {
var stream = gulp.src('src/*.less')
.pipe(concat('player.less'))
.pipe(less())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false,
}))
.pipe(minifyCss())
.pipe(rename({suffix:'.min'}));
assets_css = stream.pipe(clone());
return stream.pipe(gulp.dest('dist/'));
});
gulp.task('build', ['build-js', 'build-css'], function() {
return merge2(assets_css.pipe(css2js()), assets_js)
.pipe(concat('player-with-css.js'))
.pipe(uglify())
.pipe(header(banner, {pkg: pkg}))
.pipe(rename({suffix:'.min'}))
.pipe(gulp.dest('dist/'));
});
gulp.task('default', ['build']);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。