Skip to content

Commit 840957d

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

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/plugin/css-variables-collector.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ 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/`);
36+
console.log(filename, regex.test(filename));
3537
const include = !filename ||
36-
(this.config.libPath ? filename.startsWith(`/resources/${this.config.libPath}/themes/`) : true);
38+
(this.config.libPath ? regex.test(filename) : true);
3739
return include;
3840
},
3941

@@ -45,9 +47,11 @@ CSSVariablesCollectorPlugin.prototype = {
4547
const vars = {};
4648
Object.keys(this.vars).forEach((key) => {
4749
const override = this.vars[key].updateAfterEval && varsOverride[key] !== undefined;
48-
if (override && process && process.env && process.env.LESS_OPENUI5_CSSVARS_REPORT_OVERRIDE) {
50+
/*
51+
if (override) {
4952
console.log(`Override variable "${key}" from "${this.vars[key].css}" to "${varsOverride[key].css}"`);
5053
}
54+
*/
5155
vars[key] = {
5256
css: override ? varsOverride[key].css : this.vars[key].css,
5357
export: this.vars[key].export

0 commit comments

Comments
 (0)