Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
There is no import of NPM package. How is it being used?

mediacms-vjs-plugin is a custom plugin for Video.js.

The MediaCmsVjsPlugin.js source file starts with:

import { version as VERSION } from '../package.json';

import 'mediacms-vjs-plugin-font-icons/dist/mediacms-vjs-icons.css';
import './styles.scss';

As can be seen, there is no import of videojs. However, videojs is being used all over the code like:


function generatePlugin() {
    const videojsComponent = videojs.getComponent('Component');
    const videojsClickableComponent = videojs.getComponent('ClickableComponent');
    const videojsComponentButton = videojs.getComponent('Button');

    const __MediaCMSComponent__ = videojs.extend(videojsComponent, {
    

How is it possible to use videojs without importing it first?

Its package.json file specifies videojs as a peer dependency:

  "peerDependencies": {
    "video.js": "^7.12.3"
  },

Could it be that whenever there is a peer dependency, we don't have to import it explicitly?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Since it's a plugin, It's likely written on the assumption that you already have videojs in your project and that you're importing it somewhere, before importing the plugin.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!