Page MenuHomePhabricator

No OneTemporary

diff --git a/gulpfile.js b/gulpfile.js
index 2c16631..47232b2 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,67 +1,72 @@
'use strict';
var babelify = require('babelify');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var uglify = require('gulp-uglify');
-var gutil = require('gulp-util');
var filelog = require('gulp-filelog');
var header = require('gulp-header');
var sourcemaps = require('gulp-sourcemaps');
-
+var through = require('through2');
+var parseArgs = require('minimist');
var fs = require('fs');
var path = require('path');
var PKG_INFO = require('./package.json');
// gulp-header.
var BANNER = fs.readFileSync('banner.txt').toString();
var BANNER_OPTS = {
pkg: PKG_INFO,
currentYear: (new Date()).getFullYear()
};
+var noop = function() {
+ return through.obj();
+}
+
+var env = parseArgs(process.argv.slice(2));
gulp.task('lint', function () {
return gulp.src('lib/**/*.js')
.pipe(filelog('lint'))
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter(stylish));
});
gulp.task('build', function () {
var dest;
- var isProduction = (gutil.env.type === 'production');
+ var isProduction = (env.type === 'production');
if (isProduction) {
dest = PKG_INFO.name + '.min.js';
} else {
dest = PKG_INFO.name + '.js';
}
return browserify([path.join(__dirname, PKG_INFO.main)],
{standalone: PKG_INFO.name,
debug: true})
.transform(babelify)
.bundle()
.pipe(source(dest))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(filelog('build'))
- .pipe(isProduction ? uglify({mangle: false}) : gutil.noop())
+ .pipe(isProduction ? uglify({mangle: false}) : noop())
.pipe(header(BANNER, BANNER_OPTS))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', function() {
gulp.watch(['lib/**/*.js'], gulp.series('lint', 'build'));
});
gulp.task('dist', gulp.series('lint', 'build'));
gulp.task('default', gulp.series('dist'));
diff --git a/package.json b/package.json
index 11dc777..d2652fa 100644
--- a/package.json
+++ b/package.json
@@ -1,49 +1,50 @@
{
"name": "sylkrtc",
"version": "1.0.1",
"main": "lib/sylkrtc.js",
"description": "SylkServer WebRTC Gateway client library",
"repository": {
"type": "git",
"url": "git://github.com/AGProjects/sylkrtc.git"
},
"keywords": [],
"author": "AG Projects",
"contributors": [
"Tijmen de Mes <tijmen@ag-projects.com>",
"Saúl Ibarra Corretgé <saul@ag-projects.com>"
],
"license": "MIT",
"readmeFilename": "README.md",
"browserify": {
"transform": [
"babelify"
]
},
"dependencies": {
"attachmediastream": "^2.0.0",
"blueimp-md5": "^2.10.0",
"bowser": "^2.7.0",
"debug": "^2.6.8",
"sdp-transform": "^2.3.0",
"uuid": "^3.1.0",
"webrtc-adapter": "4.1.1",
"websocket": "^1.0.28"
},
"devDependencies": {
"babel-preset-es2015": "^6.9.0",
"babelify": "^7.3.0",
"browserify": "^16.5.0",
"gulp": "^4.0.2",
"gulp-filelog": "^0.4.1",
"gulp-header": "^2.0.9",
"gulp-jshint": "^2.0.1",
"gulp-sourcemaps": "^2.6.1",
"gulp-uglify": "^3.0.0",
- "gulp-util": "^3.0.7",
"jshint": "^2.9.5",
"jshint-stylish": "^2.2.0",
+ "minimist": "^1.2.0",
+ "through2": "^3.0.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^2.0.0"
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Feb 1, 2:16 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3489391
Default Alt Text
(3 KB)

Event Timeline