You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building this, the CustomApi.MyName is irrelevant because it isn't used anywhere. The main question is: Is there a way to get an output, which I can process afterwards, so I get a clear list of ONLY the used variables of my definition file.
In an additional step I would like to get a simple result, such as ['MyPrice', 'MyBool'].
Notes
A (rather ugly) solution would be to simply search for all usages of CustomApi. inside the minified code
The CustomApi doesn't have to be global and could also be solved with imports if it helps to get my desired output
Overall idea
Note: This is only a POC and there might be general room for improvements
In an online-editor you can create so called components
Devs can write custom code in their local env, with access to those components
For a "neat dev experience" we provide the components.d.ts file
Afterwards the dev can upload the built files
We analyze those files and "extract" the information which components are actually used
Based on this we can decide which components we have to expose in the final product
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Example
Lets say I have the following files:
components.d.ts
index.ts
Desired output
When building this, the
CustomApi.MyName
is irrelevant because it isn't used anywhere.The main question is: Is there a way to get an output, which I can process afterwards, so I get a clear list of ONLY the used variables of my definition file.
In an additional step I would like to get a simple result, such as
['MyPrice', 'MyBool']
.Notes
CustomApi.
inside the minified codeCustomApi
doesn't have to be global and could also be solved withimports
if it helps to get my desired outputOverall idea
components
components
components.d.ts
filecomponents
are actually usedcomponents
we have to expose in the final productBeta Was this translation helpful? Give feedback.
All reactions