Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda