fix: apply import.meta transform to ALL platforms (web + native)

The previous fix only applied unstable_transformImportMeta to the native
platform, but Zustand 5's import.meta.env usage also breaks on web.

Moving the transform to the top level ensures it applies to both web and
native platforms, fixing the "Cannot use 'import.meta' outside a module"
error across all platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-12-02 11:25:18 +00:00
parent 7896bdd42c
commit 6615b23c8b

View File

@@ -1,7 +1,17 @@
module.exports = function (api) {
api.cache(true);
const expoPreset = [
"babel-preset-expo",
{
// Transform `import.meta` for ALL platforms (web + native)
// Required for modern ESM deps like Zustand 5 that use import.meta.env
unstable_transformImportMeta: true,
},
];
return {
presets: ["babel-preset-expo"],
presets: [expoPreset],
plugins: [
[
"react-native-unistyles/plugin",