Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with webpack #4

Open
jide opened this issue Oct 3, 2017 · 0 comments
Open

Usage with webpack #4

jide opened this issue Oct 3, 2017 · 0 comments

Comments

@jide
Copy link

jide commented Oct 3, 2017

Hey,

I'm coming from hell, which is trying to make videojs-contrib-hls work with webpack videojs/videojs-contrib-hls#600, so I decided to give this module a try, and I was more lucky.

package.json should have a main entry pointing to the dist file, and in an ideal world dependencies to hls.js and video.js should be handled using the webpack standard factory function instead of relying on globals.

In the meantime, I thought I should put my working solution here :

npm i video.js@5
npm i videojs-hlsjs
npm i hlsjs.js
// webpack.config.js
{
  resolve: {
    alias: {
      'videojs-hlsjs': 'videojs-hlsjs/dist/videojs-hlsjs.js'
    },
  },

  plugins: [
    new webpack.ProvidePlugin({
      videojs: 'video.js',
      'window.videojs': 'video.js',
      'window.Hls': 'hls.js'
    })
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant