Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor
2 Replies

Avatar

Correct answer by
Employee Advisor

Avatar

Community Advisor

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.