Skip to content

Commit 30d39e9

Browse files
committed
build: silent sass bundling
* No longer prints the whole SASS file-tree when running the `build:release` task. * Added a new options that allows disabling STDOUT messages. STDERR is important for error messages.
1 parent 75996b5 commit 30d39e9

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

tools/gulp/tasks/release.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ task(':package:theming', [':bundle:theming-scss'],
9898

9999
/** Bundles all scss requires for theming into a single scss file in the root of the package. */
100100
task(':bundle:theming-scss', execNodeTask(
101-
'scss-bundle',
102-
'scss-bundle', [
103-
'-e', themingEntryPointPath,
104-
'-d', themingBundlePath,
105-
]));
101+
'scss-bundle', 'scss-bundle', ['-e', themingEntryPointPath, '-d', themingBundlePath], {
102+
silentStdout: true
103+
}
104+
));
106105

107106
/** Make sure we're logged in. */
108107
task(':publish:whoami', execTask('npm', ['whoami'], {

tools/gulp/util/task_helpers.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ export function sassBuildTask(dest: string, root: string, minify = false) {
5454

5555
/** Options that can be passed to execTask or execNodeTask. */
5656
export interface ExecTaskOptions {
57-
// Whether to output to STDERR and STDOUT.
57+
// Whether STDOUT and STDERR messages should be printed.
5858
silent?: boolean;
59+
// Whether STDOUT messages should be printed.
60+
silentStdout?: boolean;
5961
// If an error happens, this will replace the standard error.
6062
errMessage?: string;
6163
}
@@ -65,14 +67,12 @@ export function execTask(binPath: string, args: string[], options: ExecTaskOptio
6567
return (done: (err?: string) => void) => {
6668
const childProcess = child_process.spawn(binPath, args);
6769

70+
if (!options.silentStdout && !options.silent) {
71+
childProcess.stdout.on('data', (data: string) => process.stdout.write(data));
72+
}
73+
6874
if (!options.silent) {
69-
childProcess.stdout.on('data', (data: string) => {
70-
process.stdout.write(data);
71-
});
72-
73-
childProcess.stderr.on('data', (data: string) => {
74-
process.stderr.write(data);
75-
});
75+
childProcess.stderr.on('data', (data: string) => process.stderr.write(data));
7676
}
7777

7878
childProcess.on('close', (code: number) => {

0 commit comments

Comments
 (0)