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

156
Views
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
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!