Use browserfiy-shim globally. (#710)
This is because media-sources requires video.js but doesn't require browserify-shim itself, so, instead we need to make sure that we browserify-shim all the dependencies.
Showing
3 changed files
with
4 additions
and
4 deletions
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | "build:js": "npm-run-all build:js:babel build:js:browserify build:js:bannerize build:js:uglify", | 16 | "build:js": "npm-run-all build:js:babel build:js:browserify build:js:bannerize build:js:uglify", |
17 | "build:js:babel": "babel src -d es5", | 17 | "build:js:babel": "babel src -d es5", |
18 | "build:js:bannerize": "bannerize dist/videojs-contrib-hls.js --banner=scripts/banner.ejs", | 18 | "build:js:bannerize": "bannerize dist/videojs-contrib-hls.js --banner=scripts/banner.ejs", |
19 | "build:js:browserify": "browserify . -s videojs-contrib-hls -t browserify-shim -o dist/videojs-contrib-hls.js", | 19 | "build:js:browserify": "browserify . -s videojs-contrib-hls -g browserify-shim -o dist/videojs-contrib-hls.js", |
20 | "build:js:uglify": "uglifyjs dist/videojs-contrib-hls.js --comments --mangle --compress -o dist/videojs-contrib-hls.min.js", | 20 | "build:js:uglify": "uglifyjs dist/videojs-contrib-hls.js --comments --mangle --compress -o dist/videojs-contrib-hls.min.js", |
21 | "build:test": "npm-run-all build:test:manifest build:test:js", | 21 | "build:test": "npm-run-all build:test:manifest build:test:js", |
22 | "build:test:js": "node scripts/build-test.js", | 22 | "build:test:js": "node scripts/build-test.js", |
... | @@ -42,7 +42,7 @@ | ... | @@ -42,7 +42,7 @@ |
42 | "watch:docs": "nodemon --watch src/ --exec npm run docs", | 42 | "watch:docs": "nodemon --watch src/ --exec npm run docs", |
43 | "watch:js": "npm-run-all -p watch:js:babel watch:js:browserify", | 43 | "watch:js": "npm-run-all -p watch:js:babel watch:js:browserify", |
44 | "watch:js:babel": "npm run build:js:babel -- --watch", | 44 | "watch:js:babel": "npm run build:js:babel -- --watch", |
45 | "watch:js:browserify": "watchify . -v -t browserify-shim -o dist/videojs-contrib-hls.js", | 45 | "watch:js:browserify": "watchify . -v -g browserify-shim -o dist/videojs-contrib-hls.js", |
46 | "watch:test": "npm-run-all -p watch:test:*", | 46 | "watch:test": "npm-run-all -p watch:test:*", |
47 | "watch:test:js": "node scripts/watch-test.js", | 47 | "watch:test:js": "node scripts/watch-test.js", |
48 | "watch:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.watch();\"", | 48 | "watch:test:manifest": "node -e \"var b=require('./scripts/manifest-data.js'); b.watch();\"", | ... | ... |
... | @@ -5,7 +5,7 @@ var glob = require('glob'); | ... | @@ -5,7 +5,7 @@ var glob = require('glob'); |
5 | glob('test/**/*.test.js', function(err, files) { | 5 | glob('test/**/*.test.js', function(err, files) { |
6 | browserify(files) | 6 | browserify(files) |
7 | .transform('babelify') | 7 | .transform('babelify') |
8 | .transform('browserify-shim') | 8 | .transform('browserify-shim', {global: true}) |
9 | .bundle() | 9 | .bundle() |
10 | .pipe(fs.createWriteStream('dist-test/videojs-contrib-hls.js')); | 10 | .pipe(fs.createWriteStream('dist-test/videojs-contrib-hls.js')); |
11 | }); | 11 | }); | ... | ... |
... | @@ -10,7 +10,7 @@ glob('test/**/*.test.js', function(err, files) { | ... | @@ -10,7 +10,7 @@ glob('test/**/*.test.js', function(err, files) { |
10 | plugin: [watchify] | 10 | plugin: [watchify] |
11 | }) | 11 | }) |
12 | .transform('babelify') | 12 | .transform('babelify') |
13 | .transform('browserify-shim'); | 13 | .transform('browserify-shim', {global: true}); |
14 | 14 | ||
15 | var bundle = function() { | 15 | var bundle = function() { |
16 | b.bundle().pipe(fs.createWriteStream('dist-test/videojs-contrib-hls.js')); | 16 | b.bundle().pipe(fs.createWriteStream('dist-test/videojs-contrib-hls.js')); | ... | ... |
-
Please register or sign in to post a comment