Loaders are transformations that are applied to the source code of a module or a script. They allow you to pre-process files or html with javascript inside as you import or “load” them. Thus, loaders are kind of like “tasks” in other build tools and provide a powerful way to handle front-end build steps.
The idea is to download a JS programm and run it native locally in a runtime browser (webview2) with some modifications in it, based on a script you deliver before. I call this a multiple deployment as a fixture:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
For example, you can use loaders to tell a website to load a CSS with javascript file and to modify parameters in JavaScript before you run it in a local browser webview2.
Loaders can be chained. Each loader in the chain applies transformations to the processed resource for example load the url as a stream in a memo with lines, modify two parameters (frequency and title in our example) an run it with navigatetoString(memoHTML.text); on a browser:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
The above is the detailed content of JavaScript Loader. For more information, please follow other related articles on the PHP Chinese website!