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

269
Views
Rollup get list of inputs (like esbuild metafile)

Yo! I have to use Rollup's JavaScript API to bundle some code directly in the browser (it's an online REPL). I use UNPKG to fetch the packages, and at some point, I need a list of all the imported file, packages etc.

I am used to bundle in the browser using esbuild; with esbuild's JavaScript API I can get the list I need, once the bundle is created, by accessing bundle?.metafile?.inputs. The bundle.metafile.inputs looks like this :

{
    'a:App.jsx': {
        bytes: 368,
        imports: [
            {
                kind: "import-statement",
                path: "b:https://unpkg.com/react"
            },
            {
                kind: "import-statement",
                path: "b:https://unpkg.com/react-dom/client"
            }
        ]
        },
    'b:https://unpkg.com/react': {
        bytes: 190,
        imports:[
            {
                kind: "require-call",
                path: "b:https://unpkg.com/react@18.2.0/cjs/react.production.min.js"
            }
        ]
    }
    // ... here all of the other imports and imports of imports
}

I looked for something similar in Rollup's documentation but couldn't find any.

Is there anything similar to what I need in Rollup's JS API, or perhaps any existing plugin specific for a usecase without file-system (I mean, with just a virtual one), or do I have to create a similar plugin myself?

Thx in advance,

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!