Skip to content

Commit c003504

Browse files
committed
fix(logger): 优化pack/server logger
1 parent d31c541 commit c003504

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

src/commands/pack.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,6 @@ exports.run = function (options) {
4343
}
4444
}
4545

46-
const statsInfo = stats.toJson({
47-
errorDetails: true
48-
});
49-
50-
if (statsInfo.errors.length > 0) {
51-
statsInfo.errors.map((err) => {
52-
error(err.red);
53-
info();
54-
})
55-
}
56-
57-
// TODO 测试warning情况
58-
if (statsInfo.warnings.length > 0) {
59-
statsInfo.warnings.map((warning) => {
60-
warn(err.yellow);
61-
info();
62-
})
63-
}
64-
65-
statsInfo.assets.map((asset) => {
66-
const size = asset.size > 1024 ?
67-
(asset.size / 1024).toFixed(2) + ' kB' :
68-
asset.size + ' bytes';
69-
70-
// .cache文件不显示
71-
if (!/\.cache$/.test(asset.name)) {
72-
log('packed asset: '.gray + asset.name + ' - ' + size);
73-
}
74-
})
75-
76-
info();
77-
7846
project.packCallbacks.forEach(cb => cb(options, stats));
7947
});
8048
};

src/commands/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ exports.run = (options) => {
112112

113113
// 输出server运行中 error/warning 信息
114114
compiler.watch({}, function(err, stats) {
115-
const statsInfo = stats.toJson({errorDetails: true}),
115+
const statsInfo = stats.toJson({errorDetails: false}),
116116
logMethods = {
117117
errors: error,
118118
warnings: warn

src/models/Project.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ class Project {
239239
.forEach((fp) => fs.unlinkSync(fp));
240240

241241
if (!err) {
242-
243242
let statsInfo = stats.toJson({
244243
errorDetails: false
245244
});

0 commit comments

Comments
 (0)