Skip to content

Commit e419503

Browse files
authored
chore(build): watch the less files in Base theme (#183)
1 parent 16c65da commit e419503

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/main/rollup.config.less.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ const StyleBelizeHcbMap = {};
1111
const SAP_BELIZE = "sap_belize";
1212
const SAP_BELIZE_HCB = "sap_belize_hcb";
1313

14+
function ui5LessPlugin() {
15+
const isLess = fileName => path.extname(fileName) === ".less";
16+
17+
return {
18+
name: "ui5-less-plugin",
19+
transform(code, file) {
20+
if (isLess(file)) {
21+
this.addWatchFile(path.join(process.cwd(), `src/themes/base/${path.basename(file)}`));
22+
}
23+
24+
return {
25+
code,
26+
map: null,
27+
};
28+
}
29+
};
30+
}
31+
1432
const getPlugins = () => {
1533
const plugins = [];
1634

@@ -40,6 +58,8 @@ const getPlugins = () => {
4058
}
4159
}));
4260

61+
plugins.push(ui5LessPlugin());
62+
4363
return plugins;
4464
};
4565

0 commit comments

Comments
 (0)