Since all plugins are supposed to be compiled as IIFEs, you can test if they are using the global DFL or not by analyzing the output binary.
A cheap but good enough way of doing so if the following:
tail -n1 dist/index.js | grep -Eq '\(([^)]+,\s*)?((globalThis|window)\.)?DFL(,[^)]+)?\)+;?$'
This verifies that the last line of the script self-executes itself by passing in DFL. An exit status of 0 means that global DFL is used, 1 means it isn't.
It should account for different ways of writing IIFEs (not just rollup's).
Since all plugins are supposed to be compiled as IIFEs, you can test if they are using the global DFL or not by analyzing the output binary.
A cheap but good enough way of doing so if the following:
This verifies that the last line of the script self-executes itself by passing in DFL. An exit status of
0means that global DFL is used,1means it isn't.It should account for different ways of writing IIFEs (not just rollup's).