-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclientlib-generator.js
57 lines (52 loc) · 1.4 KB
/
clientlib-generator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
Copyright 2022 Adobe
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in
accordance with the terms of the Adobe license agreement accompanying
it.
*/
var clientlib = require("aem-clientlib-generator");
var path = require("path");
var process = require("process");
const CLIENTLIB_DIR = process.env.npm_config_directory || "theme-clientlibs"
const CLIENTLIB_CATEGORY = process.env.npm_config_category
if(!CLIENTLIB_CATEGORY){
throw 'category parameter should be present'
}
clientlib(
[
{
categories: [CLIENTLIB_CATEGORY],
name: CLIENTLIB_CATEGORY,
cssProcessor: ["default:none", "min:none"],
jsProcessor: ["default:none", "min:gcc;compilationLevel=whitespace"],
allowProxy: true,
customProperties: [
"formsTheme"
],
formsTheme: "true",
serializationFormat: "xml",
assets: {
resources: {
base: "css/resources/images",
files: ["dist/**/*.svg", "dist/**/*.gif", "dist/**/*.png"]
},
js: [
{ src: "dist/theme.js", dest: "theme.js" },
{
src: "dist/theme.js.map",
dest: "theme.js.map",
},
],
css: ["dist/theme.css", "dist/theme.css.map"],
},
}
],
{
cwd: __dirname,
clientLibRoot: path.join(__dirname, CLIENTLIB_DIR),
},
function () {
console.log("clientlibs created");
}
);