34 lines
726 B
JavaScript
34 lines
726 B
JavaScript
module.exports = function (api) {
|
||
api.cache(true)
|
||
|
||
return {
|
||
presets: [
|
||
[
|
||
'babel-preset-expo',
|
||
{
|
||
jsxImportSource: 'nativewind',
|
||
},
|
||
],
|
||
'nativewind/babel',
|
||
],
|
||
plugins: [
|
||
'react-native-worklets/plugin',
|
||
// TypeScript插件配置,确保不干扰JSX处理
|
||
[
|
||
'@babel/plugin-transform-typescript',
|
||
{
|
||
allowDeclareFields: true,
|
||
allowNamespaces: true,
|
||
isTSX: true,
|
||
allExtensions: true,
|
||
},
|
||
],
|
||
],
|
||
// 使用assumptions统一设置类属性行为,避免loose模式冲突
|
||
assumptions: {
|
||
setPublicClassFields: true,
|
||
privateFieldsAsSymbols: true,
|
||
},
|
||
}
|
||
}
|