Ferdinand Ferdinand - 14 days ago 6
Javascript Question

How to include a framework?

I'm trying to use VideoJS but I don't understand the files I have to include. This is not proper to VideoJS because I've had this problem with other frameworks : Inside the zip, there are different folders like "dist", "lib", etc.

Since there is videojs-background.js (seems to be the only JavaScript file ton include), in both folders, which one do I have to include ?
Do I need something else ?

Thank you

@edit : Thank you for your answer. Could you please explain what these folders are ?

Answer

This depends on which library you are trying to include and whether you use any module bundler in your app. Therefore, you should consult the README / documentation of the library. In your example of video.js, there is a Getting Started guide on their homepage that explains various ways to include the code.

Regarding your question about different folders: most of the time, the downloads include both the source code of the library (often in directories like src, lib), as well as some bundled-minified code (often in directories like dist, bundle and with file ending .min.js)

Comments