mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
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>
25 lines
477 B
JavaScript
25 lines
477 B
JavaScript
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: [expoPreset],
|
|
plugins: [
|
|
[
|
|
"react-native-unistyles/plugin",
|
|
{
|
|
root: "src",
|
|
},
|
|
],
|
|
],
|
|
};
|
|
};
|