Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ docs/
/styles/
coverage/
.vscode/
stats.html
42 changes: 41 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,45 @@ module.exports = {
'@babel/preset-react',
'@babel/preset-typescript',
],
plugins: ['@babel/proposal-object-rest-spread'],
plugins: [
[
'babel-plugin-react-compiler',
{
// Support React 17 as a minimum
target: '17',
logger: {
/**
* @param {string | null} filename
* @param {import('babel-plugin-react-compiler').LoggerEvent} event
*/
logEvent(filename, event) {
if (
event.kind === 'CompileError' ||
event.kind === 'CompileSkip' ||
event.kind === 'PipelineError'
) {
if (event.kind === 'CompileError') {
console.warn(
`\n[React Compiler] \x1b[33m${event.kind}\x1b[0m: ${filename}`,
)
}

if (event.detail?.reason) {
console.error(`Reason: ${event.detail.reason}`)
}
}
},
},
},
],
'@babel/proposal-object-rest-spread',
[
'@babel/plugin-transform-runtime',
{
// Prevent helpers from being inlined in the output code
// https://babeljs.io/docs/babel-plugin-transform-runtime#version
version: '^7.28.4',
},
],
],
}
Loading