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'}
]
...