forked from layerx-labs/design-tokens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
54 lines (50 loc) · 1.35 KB
/
config.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
const StyleDictionaryPackage = require("style-dictionary");
function getStyleDictionaryConfig(product, platform) {
return {
source: [
`tokens/products/${product}/*.json`,
"tokens/globals/**/*.json",
`tokens/platforms/${platform}/*.json`,
],
platforms: {
css: {
transformGroup: "css",
buildPath: `build/web/${product}/`,
files: [
{
destination: "tokens.css",
format: "css/variables",
},
],
},
ts: {
transformGroup: "js",
buildPath: `build/web/${product}/`,
files: [
{
destination: "tokens.ts",
format: "javascript/es6",
},
{
destination: "tokens.d.ts",
format: "typescript/es6-declarations",
},
],
},
},
};
}
console.log("Build started...");
console.log("\n====================");
["taikai", "bepro", "dappkit"].map(function (product) {
["css", "ts"].map(function (platform) {
console.log(`\n🔥 ${platform} tokens → ${product}`);
const StyleDictionary = StyleDictionaryPackage.extend(
getStyleDictionaryConfig(product, platform)
);
StyleDictionary.buildPlatform(platform);
console.log("End processing");
});
});
console.log("\n====================\n");
console.log("Build completed! 🎉");