Skip to content

Commit

Permalink
fix: don't show unnecessary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jan 20, 2017
1 parent 246af48 commit b301246
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
6 changes: 2 additions & 4 deletions src/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ export default async function(options: *) {
const compiler = await bundler({ ...options, devtool: options.sourcemaps ? 'source-map' : null });
const status = await runCompilerAsync(compiler);

if (!options.quiet) {
console.log(status.toString({
colors: true,
}));
if (options.quiet !== false) {
console.log(status.toString('errors-only'));
}

const result = status.toJson();
Expand Down
8 changes: 4 additions & 4 deletions src/configure-bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default async function(options: *) {
}

const files = await Promise.all(
options.entry.map(
f => existsFileAsync(fs, path.join(WORKINGDIR, f))
)
);
options.entry.map(
f => existsFileAsync(fs, path.join(WORKINGDIR, f))
)
);

const entry = {};

Expand Down
7 changes: 7 additions & 0 deletions src/configure-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,11 @@ export default (options: Options) => ({
path.join(options.context, 'node_modules'),
],
},

devServer: {
stats: {
colors: true,
chunks: false,
},
},
});
6 changes: 2 additions & 4 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ export default async function(options: *) {

const status = await runCompilerAsync(compiler);

if (!options.quiet) {
console.log(status.toString({
colors: true,
}));
if (options.quiet !== false) {
console.log(status.toString('errors-only'));
}

const result = status.toJson();
Expand Down
22 changes: 11 additions & 11 deletions src/quik-middleware-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ export default function(options: *) {
output: OUTPUTFILE,
production: false,
})
.then(async compiler => {
const memoryFs = new MemoryFS();
.then(async compiler => {
const memoryFs = new MemoryFS();

compiler.outputFileSystem = memoryFs;
compiler.outputFileSystem = memoryFs;

const status = await runCompilerAsync(compiler);
const result = status.toJson();
const status = await runCompilerAsync(compiler);
const result = status.toJson();

if (result.errors.length) {
throw result.errors;
}
if (result.errors.length) {
throw result.errors;
}

return await readFileAsync(memoryFs, path.join(WORKINGDIR, OUTPUTFILE));
})
.catch(formatError);
return await readFileAsync(memoryFs, path.join(WORKINGDIR, OUTPUTFILE));
})
.catch(formatError);
}

yield next;
Expand Down

0 comments on commit b301246

Please sign in to comment.