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

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