Bundle specific external npm packages into a different clientlibrary in ui.frontend | Community
Skip to main content
May 8, 2023
Solved

Bundle specific external npm packages into a different clientlibrary in ui.frontend

  • May 8, 2023
  • 2 replies
  • 973 views

Hi,

 

Is it possible to bundle some specific npm packages / js+css files into discrete packages in ui.frontend and then reference them? Similar to how we bundle clientlib-base now (but with a different name).

 

Thanks

Souvik

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

milind_bachani
Adobe Employee
milind_bachaniAdobe EmployeeAccepted solution
Adobe Employee
May 8, 2023
Rohit_Utreja
Community Advisor
Community Advisor
May 9, 2023

Hi @souvik_chakraborty911,

 

Yes, It is possible.

 

You can create a new clientlibs with a new folder structure in ui.frontend. Include all related custom code in it. Register it as a clientlib in the ui.frontend module.

Now, Add the dependency of this clientlibs in your actual clientlibs. 

 

Please refer below URL for more details.

https://blog.3sharecorp.com/aem-code-splitting-dynamic-imports-typescript

 

I hope it helps.