Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

212
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda