Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Is it possible to create component specific clientlibs in AEM6.5 Webpack?

Avatar

Avatar
Validate 1
Level 1
vidhu
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
vidhu
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
vidhu
Level 1

29-01-2021

I am using AEM 6.5 ui.frontend webpack. Here if I compile scss to css it will complie in clientlibs-site/site.css. But I want component scss files to compile at the component level, I don't one one css file for all the components. Is this possible in Webpack? If yes, then how I can configure this.

View Entire Topic

Avatar

Avatar
Springboard
MVP
Suraj_Kamdi
MVP

Likes

142 likes

Total Posts

156 posts

Correct Reply

41 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 3
View profile

Avatar
Springboard
MVP
Suraj_Kamdi
MVP

Likes

142 likes

Total Posts

156 posts

Correct Reply

41 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 3
View profile
Suraj_Kamdi
MVP

29-01-2021

@vidhu 

Yes, it is possible to create a separate component-specific clientlib folder using ui.frontend module.

 

Create separate <component-name>clientlib.config.js

and set the clientlib path as follows

const CLIENTLIB_DIR = path.join(
__dirname,
'..',
'ui.apps',
'src',
'main',
'content',
'jcr_root',
'apps',
'aem-project',
'components',
'component-name'
'clientlibs'
);

also, you need o update the respective module's configuration in the as same as clientlib.config.js file.