Open TablesawTablesawsen opened 8 years ago
For any who come after, I got this working with browserify-shim:
"browser": {
"videojs-vast-vpaid": "./node_modules/videojs-vast-vpaid/bin/videojs_5.vast.vpaid.min.js"
},
"browserify-shim": {
"videojs-vast-vpaid": {
"depends": [
"video.js:videojs"
]
}
}
Similar to the issues in #91, I am getting a variety of errors when I attempt to load this plugin using browserify. Specifically, I am using browserify 13.0.1 with babelify 7.3.0. My video.js is at 5.10.4 and my videojs-vast-vpaid is at 2.0.1 (all installed via npm). I have tried a number of different inclusions and gotten different errors, and I cannot be sure where the problem is.
When attempting to import/require 'videojs-vast-vpaid', I get the error, "Error: Cannot find module 'videojs-vast-vpaid/videojs_5.vast.vpaid.js' from '/home/tablesaw/dev/player/src'", during browserifying.
When attempting to import/require 'videojs-vast-vpaid/bin/videojs_5.vast.vpaid.js', I get the error, "Error: Cannot find module './IVPAIDAdUnit' from '/home/tablesaw/dev/player/node_modules/videojs-vast-vpaid/bin'", during browserifying.
When attempting to import/require 'videojs-vast-vpaid/bin/videojs_5.vast.vpaid.min.js', the build succeeds, and I runtime I get an error:
When attempting to import/require 'videojs-vast-vpaid/src/scripts/videojs_5.vast.vpaid.js', I get the error, "Error: Cannot find module 'VPAIDFLASHClient/js/VPAIDFLASHClient' from '/home/tablesaw/dev/player/node_modules/videojs-vast-vpaid/src/scripts/ads/vast'" during browserifying. [This is the same result as #91]
The following attempts involve using broswerify-shim (3.8.12) to incorporate the file.
Using the shim setup:
The build succeeds, but at runtime, I get the error:
If I shim the minified script, the build succeeds and I get the error:
If I shim "/node_modules/videojs-vast-vpaid/src/scripts/videojs_5.vast.vpaid.js", I get a similar error to the first shim:
_prelude.js:1 Uncaught Error: Cannot find module './plugin/components/ads-label_5'
With the various builds, it's hard for me to to tell which if any of these methods of incorporating the plugin should work with browserify. Can someone confirm what is the intended method, so that we can possibly investigate whether there is an underlying bug?