Skip to content

Commit 64c00e9

Browse files
committed
[INTERNAL] Variables: use regex for library-local var detection
1 parent b2ec78d commit 64c00e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/plugin/css-variables-collector.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ CSSVariablesCollectorPlugin.prototype = {
3232
// for libraries we check that the file is within the libraries theme path
3333
// in all other cases with no filename (indicates calculated variables)
3434
// or in case of variables in standalone less files we just include them!
35+
const regex = new RegExp(`/${this.config.libPath}/themes/`);
3536
const include = !filename ||
36-
(this.config.libPath ? filename.startsWith(`/resources/${this.config.libPath}/themes/`) : true);
37+
(this.config.libPath ? regex.test(filename) : true);
3738
return include;
3839
},
3940

@@ -45,9 +46,11 @@ CSSVariablesCollectorPlugin.prototype = {
4546
const vars = {};
4647
Object.keys(this.vars).forEach((key) => {
4748
const override = this.vars[key].updateAfterEval && varsOverride[key] !== undefined;
48-
if (override && process && process.env && process.env.LESS_OPENUI5_CSSVARS_REPORT_OVERRIDE) {
49+
/*
50+
if (override) {
4951
console.log(`Override variable "${key}" from "${this.vars[key].css}" to "${varsOverride[key].css}"`);
5052
}
53+
*/
5154
vars[key] = {
5255
css: override ? varsOverride[key].css : this.vars[key].css,
5356
export: this.vars[key].export

0 commit comments

Comments
 (0)