Skip to content

Commit dc516a1

Browse files
committed
Simplify react compiler logs
1 parent 74279f6 commit dc516a1

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

babel.config.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,13 @@ module.exports = {
3030
) {
3131
if (event.kind === 'CompileError') {
3232
console.warn(
33-
`\n[React Compiler] \x1b[33mCompilation skipped\x1b[0m: ${filename}`,
33+
`\n[React Compiler] \x1b[33m${event.kind}\x1b[0m: ${filename}`,
3434
)
3535
}
3636

3737
if (event.detail?.reason) {
3838
console.error(`Reason: ${event.detail.reason}`)
3939
}
40-
41-
if (event.detail?.description) {
42-
console.error(`Details: ${event.detail.description}`)
43-
}
44-
45-
if (event.detail.primaryLocation) {
46-
const sourceLocation = event.detail.primaryLocation()
47-
48-
if (sourceLocation?.start) {
49-
console.error(
50-
`Location: Line ${sourceLocation.start.line}, Column ${sourceLocation.start.column}`,
51-
)
52-
}
53-
}
54-
55-
if (event.detail?.suggestions?.length) {
56-
console.error('Suggestions:')
57-
for (const suggestion of event.detail.suggestions) {
58-
console.error(`• ${suggestion.description}`)
59-
}
60-
}
61-
62-
if (event.data) {
63-
console.error(`Data: ${event.data}`)
64-
}
6540
}
6641
},
6742
},

0 commit comments

Comments
 (0)