Skip to content

Commit b301246

Browse files
committed
fix: don't show unnecessary logs
1 parent 246af48 commit b301246

5 files changed

+26
-23
lines changed

src/bundler.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ export default async function(options: *) {
77
const compiler = await bundler({ ...options, devtool: options.sourcemaps ? 'source-map' : null });
88
const status = await runCompilerAsync(compiler);
99

10-
if (!options.quiet) {
11-
console.log(status.toString({
12-
colors: true,
13-
}));
10+
if (options.quiet !== false) {
11+
console.log(status.toString('errors-only'));
1412
}
1513

1614
const result = status.toJson();

src/configure-bundler.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export default async function(options: *) {
1515
}
1616

1717
const files = await Promise.all(
18-
options.entry.map(
19-
f => existsFileAsync(fs, path.join(WORKINGDIR, f))
20-
)
21-
);
18+
options.entry.map(
19+
f => existsFileAsync(fs, path.join(WORKINGDIR, f))
20+
)
21+
);
2222

2323
const entry = {};
2424

src/configure-webpack.js

+7
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,11 @@ export default (options: Options) => ({
134134
path.join(options.context, 'node_modules'),
135135
],
136136
},
137+
138+
devServer: {
139+
stats: {
140+
colors: true,
141+
chunks: false,
142+
},
143+
},
137144
});

src/html.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ export default async function(options: *) {
2222

2323
const status = await runCompilerAsync(compiler);
2424

25-
if (!options.quiet) {
26-
console.log(status.toString({
27-
colors: true,
28-
}));
25+
if (options.quiet !== false) {
26+
console.log(status.toString('errors-only'));
2927
}
3028

3129
const result = status.toJson();

src/quik-middleware-js.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ export default function(options: *) {
2525
output: OUTPUTFILE,
2626
production: false,
2727
})
28-
.then(async compiler => {
29-
const memoryFs = new MemoryFS();
28+
.then(async compiler => {
29+
const memoryFs = new MemoryFS();
3030

31-
compiler.outputFileSystem = memoryFs;
31+
compiler.outputFileSystem = memoryFs;
3232

33-
const status = await runCompilerAsync(compiler);
34-
const result = status.toJson();
33+
const status = await runCompilerAsync(compiler);
34+
const result = status.toJson();
3535

36-
if (result.errors.length) {
37-
throw result.errors;
38-
}
36+
if (result.errors.length) {
37+
throw result.errors;
38+
}
3939

40-
return await readFileAsync(memoryFs, path.join(WORKINGDIR, OUTPUTFILE));
41-
})
42-
.catch(formatError);
40+
return await readFileAsync(memoryFs, path.join(WORKINGDIR, OUTPUTFILE));
41+
})
42+
.catch(formatError);
4343
}
4444

4545
yield next;

0 commit comments

Comments
 (0)