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

280
Visualizações
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
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