Create instance of the resource loader.
Optional
requestOptions: RequestOptions = Requests.DefaultRequestOptionsOptions that calibrate how requests are performed for this loader.
Optional
handleFetchResult: ((result, url, options) => void | Promise<Buffer>)Used to indicate if any pending requests are still needed so that we can report when an unused request is fulfilled.
Static
EMPTY_Generated using TypeDoc
A ResourceLoader implementation for JSDOM that only allows for fetching JS files, and provides the ability to handle and modify the fetch return result.
This can be useful for various things, such as intercepting script requests to execute them in a different manner than letting the DOM use a script tag. The return result could then be an empty string rather than the full script.
The caller is responsible for maintaining script order based on call order.
A JS file request is identified by the regular expression: /^..js(?:?.)?/g