Don’t combine JavaScript type=module by default?
-
On a website we are currently getting the following error:
Uncaught SyntaxError: Cannot use import statement outside a module (at siteground-optimizer-combined-js-4c066a5266b58bf7cc9930ae49d96fe4.js:122:508)
This is because a plugin enqueues a module script and changes the script tag via the
script_loader_tag
filter to<script type="module" src="..."></script>
.https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-type
We were wondering if it might be wise for the SiteGround Optimizer to exclude scripts with
type="module"
from combining JavaScript by default?Or are there situations where
<script type="module" src="..."></script>
can be successfully combined? (I’m not a JavaScript expert).
- The topic ‘Don’t combine JavaScript type=module by default?’ is closed to new replies.