RuntimePlugin hooks
RuntimePlugin generates Rspack runtime code. It provides the following hooks to modify this code.
You can obtain these hooks like below:
createScript
SyncWaterfallHook<[string, Chunk]>
Can modify the code executed when creating the <script> tag.
As in the following code, the crossorigin attribute can be added to the <script> tag:
createLink
SyncWaterfallHook<[string, Chunk]>
Can modify the code executed when creating a generic <link> tag.
linkPrefetch
SyncWaterfallHook<[string, Chunk]>
Can modify the code executed when creating the prefetch <link rel="prefetch"> tag.
As in the following code, the crossorigin attribute can be added to the <link> tag for prefetching:
linkPreload
SyncWaterfallHook<[string, Chunk]>
Can modify the code executed when creating the preload <link rel="preload"> tag.
As in the following code, the crossorigin attribute can be added to the <link> tag for preloading:

