Closed arthurcavallari closed 2 years ago
We are facing similar issue. We want to preload some scripts, we tried to add type to link element, but like it was said, the check done in isJavaScript
only checks script tags, while it should be also checking link elements if they have proper type set.
I am trying to use Vite.js ES modules with AEM too and we've hit this issue - We are importing javascript via client lib modules <script type="module" src="..."/>
.
https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/2691#issue-727533228 Added the fix to the library to enable support of this. @makro2400 @arthurcavallari
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Fixed by https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/2691#issue-727533228
Thanks @jamesg1
Required Information
Expected Behavior
The versioned clientlibs transformer should add a hash to script/link tags even if
<script type="module" src="..."/>
or<link rel="modulepreload" href="..."/>
Actual Behavior
These tags are excluded because of
SaxElementUtils.isCss
andSaxElementUtils.isJavaScript
, these methods do not accept<script type="module" src="..."/>
or<link rel="modulepreload" href="..."/>
Links
https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/84fcdd4bc66b020ac7c1a03134d1d7f474ce10e5/bundle/src/main/java/com/adobe/acs/commons/rewriter/impl/VersionedClientlibsTransformerFactory.java#L198
https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/84fcdd4bc66b020ac7c1a03134d1d7f474ce10e5/bundle/src/main/java/com/adobe/acs/commons/rewriter/impl/VersionedClientlibsTransformerFactory.java#L202
Links to related assets, e.g. content packages containing test components