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

175
Visualizações
How to create a webpack plugin that finds all objects with a specific field?

I'm trying to write a plugin that will collect information about all pages in the application that are marked with a special field. How can i get access to the fields of the object configuring the page?

Simplified example:

Let's say there are the following fragments in the source code:

First file:

    ...
    const SECRET_A = 'First secret phrase';
    const pageConfigA = {secretField: SECRET_A, pageUrl: 'xxx/aaa'};    
    ...

Second file:

    ...
    const SECRET_B = 'Second secret phrase';
    const pageConfigB = {secretField: SECRET_B, pageUrl: 'xxx/bbb'};    
    ...

How to create a plugin that can, for example, log (for example, to the console) all the fields of all objects in the code that contain the "secretField" field? For example, for this case, something like this should be displayed in the console during build:

    ...
    [
        {secretField: 'First secret phrase', pageUrl: 'xxx/aaa'},
        {secretField: 'Second secret phrase', pageUrl: 'xxx/bbb'}
    ]   
    ...
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