Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🧩 expo app with custom entry file #918

@mwmcode

Description

@mwmcode

Discuss anything related to Knip

Expo (v52) uses an entry that's inside node_modules

default package.json

{
    "main": "expo-router/entry",
}

when changing that to a custom entry file

modified package.json

{
    "main": "index.js",
}

./index.js

import './node_modules/expo-router/entry';

// register events like 
// https://github.com/transistorsoft/react-native-background-geolocation/issues/1582#issuecomment-1307681914

Knip starts reporting that basically everything in the project directory is not used (app/ ,hooks/ ...etc).

configuring entry to index.js doesn't seem to help

knip.json

{
  "entry": ["index.js"],
  "ignore": [
    "app.json"
  ],
  "ignoreDependencies": [
    "react-native-background-fetch",
    "@react-navigation/native-stack"
  ]
}

Any idea how to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions