-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix simple client video, newapi, hangup
- Loading branch information
1 parent
b6af4db
commit 4f11ef2
Showing
13 changed files
with
3,353 additions
and
6,792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
var gulp = require("gulp"); | ||
var gulp = require("gulp"), connect = require('gulp-connect'); | ||
var browserify = require("browserify"); | ||
var source = require("vinyl-source-stream"); | ||
var source = require("vinyl-source-stream"), buffer = require('vinyl-buffer'); | ||
var watchify = require("watchify"); | ||
var tsify = require("tsify"); | ||
var fancy_log = require("fancy-log"); | ||
var paths = { | ||
pages: ["src/*.html"], | ||
}; | ||
var watchedBrowserify = watchify( | ||
browserify({ | ||
basedir: ".", | ||
debug: true, | ||
entries: ["src/main.ts", "src/simulcast.ts"], | ||
cache: {}, | ||
packageCache: {}, | ||
}).plugin(tsify) | ||
); | ||
gulp.task("copy-html", function () { | ||
return gulp.src(paths.pages).pipe(gulp.dest("dist")); | ||
}); | ||
function bundle() { | ||
return watchedBrowserify | ||
.bundle() | ||
.on("error", fancy_log) | ||
.pipe(source("bundle.js")) | ||
.pipe(gulp.dest("dist")); | ||
var sourcemaps = require('gulp-sourcemaps'); | ||
|
||
var customOpts = {entries : [ "src/*.html", "src/*.ts" ], debug : true}; | ||
|
||
var b = watchify(browserify({ | ||
basedir : ".", | ||
debug : true, | ||
entries : [ "src/main.ts", "src/simulcast.ts" ], | ||
cache : {}, | ||
packageCache : {}, | ||
}).plugin(tsify)); | ||
|
||
gulp.task('js', bundle); // so you can run `gulp js` to build the file | ||
b.on('update', bundle); // on any dep update, runs the bundler | ||
b.on('log', fancy_log.info); // output build logs to terminal | ||
|
||
gulp.task("copy-html", function() { return gulp.src(customOpts.entries).pipe(gulp.dest("dist")); }); | ||
gulp.task('connect', function() { connect.server({root : 'dist', livereload : true, port : 3000}); }); | ||
|
||
gulp.task('default', gulp.series('js', 'copy-html', 'connect')); | ||
|
||
function bundle() | ||
{ | ||
return b | ||
.bundle() | ||
// log errors if they happen | ||
.on('error', fancy_log.error.bind(fancy_log, 'Browserify Error')) | ||
.pipe(source('bundle.js')) | ||
// optional, remove if you don't need to buffer file contents | ||
.pipe(buffer()) | ||
// optional, remove if you dont want sourcemaps | ||
.pipe(sourcemaps.init({loadMaps : true})) // loads map from browserify file | ||
// Add transformation tasks to the pipeline here. | ||
.pipe(sourcemaps.write('./')) // writes .map file | ||
.pipe(gulp.dest('./dist')); | ||
} | ||
gulp.task("default", gulp.series(gulp.parallel("copy-html"), bundle)); | ||
watchedBrowserify.on("update", bundle); | ||
watchedBrowserify.on("log", fancy_log); |
Oops, something went wrong.