Argon clientlibs
Converts a regular JS or CSS package to an AEM client library
Install
npm install --save-dev argon-clientlibs
This package works with Argon Framework. It works independently if you look a little further.
How does it work?
The package requires argon.config.js
file. The configuration looks something like this:
const clientlibDist = `apps/settings/wcm/designs`;
const projectName = `argonui`;
module.exports = {
jcrRoot: 'dist/jcr_root',
target: 'dist',
clientlibs: {
vendor: {
categories: ['argonui.vendor'],
basePath: `${clientlibDist}/${projectName}/clientlibs/vendor.publish`,
paths: [
`${clientlibDist}/${projectName}/clientlibs/vendor.publish`
]
},
global: {
categories: ['argonui.global'],
jsProcessor: [
'min:gcc',
'obfuscate=true',
'languageIn=ECMASCRIPT5',
'languageOut=ECMASCRIPT5'
],
basePath: `${clientlibDist}/${projectName}/clientlibs/global.publish`,
paths: [
`${clientlibDist}/${projectName}/clientlibs/global.publish`,
`${clientlibDist}/${projectName}/clientlibs/common.publish`,
]
}
}
};
To convert a regular JS path to a client library run following command
npx create-clientlib
OR
npx create-clientlib --config=someOtherConfig.js