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

159
Vistas
Is it possible to load a UMD module via script tag from a CDN and use it in a React component instead of importing it the usual way?

I want to use this package but it's extremely large and is adding a lot of bloat to my bundle. Due to some office restrictions I'm not able to set up lazy loading/chunking via webpack at the moment.

I found a CDN for the above lib:

https://cdn.jsdelivr.net/npm/@react-pdf/renderer@1.5.3/dist/

But I'm not sure how to use it. Like which of these many files should I load? All of them? and will the exports that I was able to access before be available as variables on the window object?

I never loaded something I needed in a React component via CDN like this. Here's what the code looked like when importing the usual way:

import { pdf, Document, Page, Image, Link } from '@react-pdf/renderer';

<Document title="hello" author="world">
  <Page style={styles.page}>
   // etc...
  </Page>
</Document>

How can I still use the lib if loading from CDN?

about 4 years ago · Juan Pablo Isaza
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