exclude expo notifications from web bundle
This commit is contained in:
@@ -277,6 +277,11 @@ export default defineConfig(
|
||||
message:
|
||||
'React is already in the global type namespace. Use named imports for runtime modules.',
|
||||
},
|
||||
{
|
||||
name: 'expo-notifications',
|
||||
message:
|
||||
'Import the helpers from #/lib/notifications/expo-helpers (or the hooks from #/lib/notifications/notifications) instead. expo-notifications is stubbed on web; importing it directly pulls ~70KB of dead weight into the web bundle.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -312,6 +317,21 @@ export default defineConfig(
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Native-only files that legitimately wrap expo-notifications. The .web.ts
|
||||
* counterparts to these files don't import the package.
|
||||
*/
|
||||
{
|
||||
files: [
|
||||
'src/lib/notifications/notifications.ts',
|
||||
'src/lib/notifications/expo-helpers.ts',
|
||||
'src/lib/hooks/useNotificationHandler.ts',
|
||||
],
|
||||
rules: {
|
||||
'no-restricted-imports': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Test files configuration
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user