-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize type attribute of script #1663
Comments
Good idea - we already have the What about adding a new option here? |
@jantimon Yeah, a new option would be suitable. |
I guess it could be |
Modules are deferred automatically, so there's no need to set one. |
Add third option, `'module'`, to the `scriptLoading` option. This partially fixes issue jantimon#1663, which is also where this solution to the problem was proposed. Although this patch doesn't give a way to freely set `type` attribute to any value, setting `scriptLoading: "module" now makes the scripts have attribute `type="module"`, which was the original motivation behind the issue.
Add third option, `'module'`, to the `scriptLoading` option. This partially fixes issue jantimon#1663, which is also where this solution to the problem was proposed. Although this patch doesn't give a way to freely set `type` attribute to any value, setting `scriptLoading: "module" now makes the scripts have attribute `type="module"`, which was the original motivation behind the issue.
Add third option, `'module'`, to the `scriptLoading` option. This partially fixes issue #1663, which is also where this solution to the problem was proposed. Although this patch doesn't give a way to freely set `type` attribute to any value, setting `scriptLoading: "module" now makes the scripts have attribute `type="module"`, which was the original motivation behind the issue.
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
not stale |
Is your feature request related to a problem? Please describe.
As of 5.41.0, webpack will output
.mjs
by default when experimental ECMAScript modules support is enabled. You can see a demo here.I'm wondering if
html-webpack-plugin
can support customizing thetype
attribute ofscript
element:Describe the solution you'd like
Add
type='module'
toscript
automatically when users enable experimental ESM support inwebpack.config.js
.Describe alternatives you've considered
Add a
type
option so users can customize as they wish.Additional context
The text was updated successfully, but these errors were encountered: