Skip to content

Commit 344657e

Browse files
authored
fix(build): removed never reached error handling
As theme override inclusions are always optional, LESS wont trigger an error in case the theme folder is not found. We also moved the related code into a new overrides.less file (which still includes the files as optional), so fetching the import on error is never reached so the code can be safely removed.
1 parent 5e5da5d commit 344657e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tasks/config/tasks.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let defaultBrowsers = browserslist(browserslist.defaults);
99
let userBrowsers = browserslist();
1010
let hasBrowserslistConfig = JSON.stringify(defaultBrowsers) !== JSON.stringify(userBrowsers);
1111

12-
var prefix = config.prefix || {};
12+
let prefix = config.prefix || {};
1313
if (!prefix.overrideBrowserslist && !hasBrowserslistConfig) {
1414
prefix.overrideBrowserslist = [
1515
'last 2 Chrome versions',
@@ -114,10 +114,7 @@ module.exports = {
114114
let
115115
regExp = {
116116
variable: /@(\S.*?)\s/,
117-
theme: /themes[/\\]+(.*?)[/\\].*/,
118-
element: /[/\\]([^*/\\]*)\.overrides/,
119117
},
120-
theme,
121118
element
122119
;
123120
if (error && error.filename && /theme.less/.test(error.filename)) {
@@ -127,10 +124,6 @@ module.exports = {
127124
console.error('Missing theme.config value for', element);
128125
}
129126
console.error('Most likely new UI was added in an update. You will need to add missing elements from theme.config.example');
130-
} else if (error.line === 84) {
131-
element = regExp.element.exec(error.message)[1];
132-
theme = regExp.theme.exec(error.message)[1];
133-
console.error(theme + ' is not an available theme for ' + element);
134127
} else {
135128
console.error(error);
136129
}

0 commit comments

Comments
 (0)