1 Star 0 Fork 38

dfs/h5player

forked from Gerald/h5player 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gulpfile.js 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
Gerald 提交于 2015-07-05 00:36 . add prefixes for css
#!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']);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ttmms/h5player.git
git@gitee.com:ttmms/h5player.git
ttmms
h5player
h5player
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385