Skip to content

Instantly share code, notes, and snippets.

@petrbela
Last active September 3, 2025 19:15
Show Gist options
  • Select an option

  • Save petrbela/245c0c71883322620dfc641ef919c4cc to your computer and use it in GitHub Desktop.

Select an option

Save petrbela/245c0c71883322620dfc641ef919c4cc to your computer and use it in GitHub Desktop.
import { withExpo } from '@expo/next-adapter'
import bundleAnalyzer from '@next/bundle-analyzer'
import { withSentryConfig } from '@sentry/nextjs'
/** @type {import('next').NextConfig} */
const nextConfig = {
// reanimated (and thus, Moti) doesn't work with strict mode currently...
// https://github.com/nandorojo/moti/issues/224
// https://github.com/necolas/react-native-web/pull/2330
// once that gets fixed, set this back to true
reactStrictMode: false,
transpilePackages: [
'@myorg/app',
'@rn-primitives/avatar',
'@rn-primitives/portal',
'@rn-primitives/slot',
'expo',
'expo-blur',
'expo-clipboard',
'expo-modules-core',
'expo-video',
'nativewind',
'react-native',
'react-native-css-interop',
'react-native-markdown-display',
'react-native-reanimated',
'react-native-web',
'solito',
'zeego',
],
async headers() {
return [
{
source: '/manifest.json',
headers: [
{ key: 'Access-Control-Allow-Headers', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: '*' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
],
},
{
source: '/api/trpc/:path*',
headers: [
{ key: 'Access-Control-Allow-Headers', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: '*' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
],
},
]
},
}
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})
export default withSentryConfig(withExpo(withBundleAnalyzer(nextConfig)), {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
org: '...',
project: 'api',
// Only print logs for uploading source maps in CI
silent: !process.env.CI,
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: true,
},
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: '/monitoring',
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
})
{
"name": "@myorg/next",
"version": "5.2.6",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"vercel-build": "cd ../../packages/server && bun run vercel-build && cd ../../apps/next && next build",
"lint": "tsc --noEmit && next lint",
"analyze": "ANALYZE=true next build"
},
"dependencies": {
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@expo/next-adapter": "6.0.0",
"@next/bundle-analyzer": "^15.1.5",
"@myorg/app": "*",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.4",
"@sentry/nextjs": "^8.42.0",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-table": "^8.20.6",
"@trpc/client": "^11.0.0-rc.660",
"@trpc/react-query": "^11.0.0-rc.660",
"@trpc/server": "^11.0.0-rc.660",
"@uppy/aws-s3": "^4.2.3",
"@uppy/core": "^4.4.5",
"@uppy/dashboard": "^4.3.4",
"@uppy/drag-drop": "^4.1.3",
"@uppy/file-input": "^4.1.3",
"@uppy/progress-bar": "^4.2.1",
"@uppy/react": "^4.2.3",
"cmdk": "^1.0.4",
"embla-carousel-react": "^8.5.2",
"expo-modules-core": "2.5.0",
"next": "15.3.2",
"next-nprogress-bar": "^2.4.3",
"next-themes": "^0.4.3",
"raf": "^3.4.1",
"react": "19.0.0",
"react-day-picker": "8",
"react-intersection-observer": "^9.15.0",
"react-native-web": "^0.20.0",
"recharts": "^2.14.1",
"setimmediate": "^1.0.5",
"sharp": "^0.33.5"
},
"devDependencies": {
"@next/eslint-plugin-next": "^15.3.2",
"@types/node": "^22.8.4",
"@types/react-native-web": "^0.19.1",
"autoprefixer": "^10.4.20"
}
}
{
"compilerOptions": {
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsxImportSource": "nativewind",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"],
"~/*": ["../../packages/app/*"]
},
"types": ["react-native-web"]
},
"include": [
"**/*.ts",
"**/*.tsx",
"app-env.d.ts",
"next-env.d.ts",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
}
{
"name": "@myorg/app",
"main": "index.ts",
"dependencies": {
"@date-fns/tz": "^1.2.0",
"@date-fns/utc": "^2.1.0",
"@floating-ui/react-native": "^0.10.7",
"@gorhom/bottom-sheet": "5.1.2",
"@hookform/resolvers": "^3.9.1",
"@myorg/server": "*",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/hooks": "^3.0.0",
"@react-navigation/elements": "^2.2.5",
"@react-navigation/native": "^7.0.14",
"@remotion/webcodecs": "^4.0.334",
"@rn-primitives/accordion": "^1.1.0",
"@rn-primitives/alert-dialog": "^1.1.0",
"@rn-primitives/avatar": "^1.1.0",
"@rn-primitives/checkbox": "^1.1.0",
"@rn-primitives/collapsible": "^1.1.0",
"@rn-primitives/context-menu": "^1.2.0",
"@rn-primitives/dialog": "^1.1.0",
"@rn-primitives/dropdown-menu": "^1.1.0",
"@rn-primitives/label": "^1.1.0",
"@rn-primitives/popover": "^1.1.0",
"@rn-primitives/portal": "^1.2.0",
"@rn-primitives/progress": "^1.2.0",
"@rn-primitives/select": "^1.2.0",
"@rn-primitives/slot": "^1.1.0",
"@rn-primitives/switch": "^1.1.0",
"@rn-primitives/toggle": "^1.1.0",
"@rn-primitives/toggle-group": "^1.1.0",
"@rn-primitives/tooltip": "^1.1.0",
"@rn-primitives/types": "^1.1.0",
"@shopify/flash-list": "2.0.2",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-query-devtools": "^5.62.3",
"@trpc/client": "^11.0.0-rc.660",
"@trpc/react-query": "^11.0.0-rc.660",
"@trpc/server": "^11.0.0-rc.660",
"base-64": "^1.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"firebase": "^11.10.0",
"hls.js": "^1.5.18",
"initials": "^3.1.2",
"linkify-it": "^5.0.0",
"lodash": "^4.17.21",
"lucide-react": "^0.468.0",
"lucide-react-native": "^0.468.0",
"moti": "latest",
"nativewind": "^4.1.23",
"pluralize": "^8.0.0",
"react-hook-form": "^7.54.0",
"react-intersection-observer": "^9.15.1",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-intersection-observer": "^0.2.0",
"react-native-markdown-display": "^7.0.2",
"react-native-modal-datetime-picker": "^18.0.0",
"react-native-reanimated": "3.16.3",
"react-native-reanimated-carousel": "^4.0.2",
"react-native-sortables": "^1.1.0",
"react-native-svg": "15.8.0",
"rn-emoji-keyboard": "^1.7.0",
"solito": "^4.4.1",
"sonner": "^1.7.1",
"sonner-native": "^0.16.2",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"thumbhash": "^0.1.1",
"use-debounce": "^10.0.4",
"usehooks-ts": "^3.1.0",
"zeego": "^3.0.6",
"zustand": "^5.0.4"
},
"devDependencies": {
"@hookform/devtools": "^4.3.3",
"@types/base-64": "^1.0.2",
"@types/linkify-it": "^5.0.0",
"@types/lodash": "^4.17.13",
"@types/pluralize": "^0.0.33"
},
"sideEffects": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment