Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1732
Closed
Open
Issue created Mar 06, 2017 by Administrator@rootContributor

eject removes linked react-scripts copy instead of symlink

Created by: tuchk4

Starts here https://github.com/facebookincubator/create-react-app/pull/1356#issuecomment-284256947

ownPath - path to react-scripts root.

If react-scripts is linked - app node_modules looks like this

App/
  |- node_modules/
                 |- react-scripts/ -> (symlink)/lib/node_modules/react-scripts
Case ownPath Notes
resolveApp('node_modules/react-scripts') APP/node_modules/react-scripts Path to react-scripts symlink
resolveOwn('.') CRA_DIR/packages/react-scripts Path to local react-scripts copy
resolveOwn('react-scripts') LOCAL_CRA/packages/react-scripts/react-scripts Path is wrong

1st and 2nd cases are the same expect eject - we remove (eject.js:160) react-scripts from node_modules after eject. In 2nd case local CRA packages/react-scripts will be removed instead of app node_modules/react-scripts.

@Timer We opted to switch to resolveOwn('.') because we don't want to hardcode the package name to be react-scripts.


I had unpleasant situation when run eject at app with linked react-scripts and my local CRA packages/react-scripts were removed with uncommitted changes :(

I have another implementation without name hardcode. I will test it and make new PR

Assignee
Assign to
Time tracking