diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0e4c5a2..bd9c314 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,15 +7,20 @@ "label": "Debug", "type": "npm", "script": "build", - "group": "build", - "problemMatcher": "$tsc" + "problemMatcher": [ + "$gulp-tsc", + "$node-sass" + ] }, { "label": "Release", "type": "npm", "script": "release", "group": "build", - "problemMatcher": "$tsc" + "problemMatcher": [ + "$gulp-tsc", + "$node-sass" + ] }, { "label": "Watch Debug", @@ -25,7 +30,24 @@ "kind": "build", "isDefault": true }, - "problemMatcher": "$tsc-watch", + "problemMatcher": [ + { + "base": "$gulp-tsc", + "background": { + "activeOnStart": false, + "beginsPattern": "^(Starting compilation in watch mode|File change detected. Starting incremental compilation)", + "endsPattern": "^Found \\d+ errors. Watching for file changes." + } + }, + { + "base": "$node-sass", + "background": { + "activeOnStart": false, + "beginsPattern": "^Rebuilding scss-code.", + "endsPattern": "^Rebuilding scss-code finished." + } + } + ], "isBackground": true, "presentation": { "reveal": "never" @@ -36,7 +58,24 @@ "type": "npm", "script": "watch-release", "group": "build", - "problemMatcher": "$tsc-watch", + "problemMatcher": [ + { + "base": "$gulp-tsc", + "background": { + "activeOnStart": false, + "beginsPattern": "^(Starting compilation in watch mode|File change detected. Starting incremental compilation)", + "endsPattern": "^Found \\d+ errors. Watching for file changes." + } + }, + { + "base": "$node-sass", + "background": { + "activeOnStart": false, + "beginsPattern": "^Rebuilding scss-code.", + "endsPattern": "^Rebuilding scss-code finished." + } + } + ], "isBackground": true, "presentation": { "reveal": "never" @@ -64,13 +103,19 @@ "label": "Rebuild", "type": "npm", "script": "rebuild", - "problemMatcher": "$tsc" + "problemMatcher": [ + "$gulp-tsc", + "$node-sass" + ] }, { "label": "Rebuild Release", "type": "npm", "script": "rebuild-release", - "problemMatcher": "$tsc" + "problemMatcher": [ + "$gulp-tsc", + "$node-sass" + ] }, { "label": "Lint", diff --git a/gulpfile.ts b/gulpfile.ts index 413c8a2..ed01e94 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -260,8 +260,9 @@ export async function Library() if (!errorMessages.includes(message)) { + let result = new RegExp(`^(${error["fileName"]})\\((\\d+|\\d+(,\\d+){1,3})\\): .* TS([\\d]+): (.*)$`).exec(message); errorMessages.push(message); - log.error(message); + console.log(`${Path.relative(process.cwd(), result[1])}(${result[2]}): ${result[4]} ${result[5]}`); } } ).pipe( @@ -333,6 +334,11 @@ Library.description = "Builds the TypeScript- and JavaScript-library."; */ export async function Theme() { + if (settings.Watch) + { + console.log("Rebuilding scss-code."); + } + return gulp.src( settings.ThemeSource("main.scss"), { @@ -341,15 +347,23 @@ export async function Theme() }).pipe( sass( { - importer: require("node-sass-tilde-importer"), - outputStyle: settings.Debug ? "expanded" : "compressed" + importer: require("node-sass-tilde-importer") } ).on("error", (error) => { - log.error( - `${error.relativePath}:${error.line}:${error.column}\n` + - `${error.messageFormatted}`); + console.log( + JSON.stringify( + { + status: error.status, + file: error.file, + line: error.line, + column: error.column, + message: error.messageOriginal, + formatted: error.formatted + }, + null, + 4)); }) ).pipe( rename( @@ -367,7 +381,15 @@ export async function Theme() } : undefined) - ); + ).on( + "end", + () => + { + if (settings.Watch) + { + console.log("Rebuilding scss-code finished.") + } + }); } Theme.description = "Builds the theme.";