활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi all,
We are trying to create a web component using stencilJS and integrate it into AEM 6.5.
StencilJS builds the web component using rollup and creates two different loaders, depending on the browser: The ESM and the ES5+polyfills loader.
The way we link the components to the HTML is:
<script type="module" src="/build/my-component-library.esm.js"></script>
<script nomodule="" src="/build/my-component-library.js"></script>
And the script lazy loads each Web component asynchronously.
We've tried to install it as a ClientLib but when we reference it on the AEM component, it bundles all JS in one file and it does not create the script tag with type module.
So we have two main issues:
We have been thinking about the following solution:
but I would like to know if there is a standard solution from AEM?
Thanks in advance
해결되었습니다! 솔루션으로 이동.
토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.
AEM clientlibs won't support much of the standard attributes at the moment. not even async, defer etc.
You can follow [1] to extend clientlibs and update this implementation to support 'type' property
[1] - http://www.nateyolles.com/blog/2016/06/custom-aem-html5-async-clientlibs
AEM clientlibs won't support much of the standard attributes at the moment. not even async, defer etc.
You can follow [1] to extend clientlibs and update this implementation to support 'type' property
[1] - http://www.nateyolles.com/blog/2016/06/custom-aem-html5-async-clientlibs
Thank you nirmaljosehere,
The most important topic is the following:
How to load a ClientLib that uses ES Modules?
We don't know if we can implement a 'standard' solution.
조회 수
답글
좋아요 수
Hi Alex,
I would be keen to know what approach you followed to solve this issue. I am stuck at the same point as we are integrating AEM with Stencil JS . One approach worked hosting the JS in dam but due to security concerns its not recommended . Looking for the reply.
조회 수
답글
좋아요 수
Hi Priya,
What we finally did is loading the StencilJS files as static files inside /etc/clientlibs folder.
We had to allocate all the StencilJS files that are the result of the build under /etc/clientlibs/....
Then we had to modify the customheaderlibs of the 'page' component to load the 'bundle' files of StencilJS (the other StencilJS files are at the same path):
Another option is having all the files in a CDN or at any other location into a static server and point them in the customheaderlibs.html file.
Finally any other resources like fonts or icons are located at a 'resources' folder inside the clientlib-base clientlib.
When the StencilJS project build is done those paths has to be taken into account.
Furthermore we use a frontend module to download the StencilJS build from Nexus and copy the files to the final location using the same principle as the aem-clientlib-generator library.
I hope this can help.
Regards,
조회 수
답글
좋아요 수
Hi Alex,
Why didn't you use resources folder in client libs to do this as you had suggested in the thread. You could have still called the scripts as below.
/etc.clientlibs/abc-folder/clientlibs/stencilscripts/resources/ui-kit.js
Do you foresee any challenge as this works too.
Thanks & Regards
조회 수
답글
좋아요 수
Hi Priya,
Yes, I think it can be an alternative too.
Regards,
조회 수
답글
좋아요 수