Reputation: 21
we know, when we use dynamic import, webpack will create script tag to load the script. But how should we add some attributes to the script created by webpack.
for example, I want to add the crossorigin attribute to the script.
the following is what webpack do for dynamic import.
Upvotes: 0
Views: 1066
Reputation: 21
Oh, I know. I find a config from the source code node_modules/webpack/lib/web/JsonpMainTemplatePlugin.js
https://webpack.js.org/configuration/output/#outputcrossoriginloading
Upvotes: 1