expo-duooomi-app/babel.config.js

36 lines
811 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = function (api) {
api.cache(true)
return {
presets: [
[
'babel-preset-expo',
{
jsxImportSource: 'nativewind',
// 禁用 loose 模式,使用 assumptions 代替
loose: false,
},
],
'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,
},
}
}