How to embed clientlibs in webpack projects
Is there any way to embed clientlibs in projects which create front-end code via webpack?
Any documentation or examples are welcomed.
Thanks,
Kiran Vedantam.
Is there any way to embed clientlibs in projects which create front-end code via webpack?
Any documentation or examples are welcomed.
Thanks,
Kiran Vedantam.
I may be off here, I am not clear on the webpack set up you have. But can you see if you can have the file/s to be embedded (included) in a common place and just import them in the entry points of templates (or any other structure you have followed)? Webpack should be able to handle import duplications I think. Not ideal probably since we won't be able to import the clientlib as whole itself may be.
Otherwise, According to https://www.npmjs.com/package/aem-clientlib-generator I see within the clientlib.config.js when generating a clientlib say "test.base.apps.mainapp", can we try to use embed for eg
// or as object (single clientlib)
libs: {
name: "test.base.apps.mainapp",
embed: "test.base.apps.commonstuff",
category: "also.optional"
assets: {
js: [
"src/frontend/js/app.js"
],
css: [
"src/frontend/css/styling.css"
]
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.