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
  • #2442
Closed
Open
Issue created Jun 01, 2017 by Administrator@rootContributor

Move more things to react-dev-utils

Created by: ForbesLindesay

I want to make react-scripts easier to fork/extend. I think the way to do that is to move as much as possible into react-dev-utils so that react-scripts can be a smaller package that changes less frequently. Then you can always just update the react-dev-utils to get most new features in react-scripts.

This should also make ejecting much less painful, as ejected projects still depend on react-dev-utils

My proposal is to move:

  1. config/webpackDevServer.config.js - This can just take publicPath and appPublic as additional options
  2. config/polyfills.js - this can just be moved as is - do we want to include it in what gets ejected still, or just reference it from react-dev-utils? I feel like just referencing it probably makes the most sense.
  3. config/env.js - This will need to take dotenvPath as an argument, and delete require.cache[require.resolve('./paths')]; will have to be done elsewhere.
  4. each of the three jest transforms - these can just be moved as is, and then they won't need to be ejected either.
  5. scripts/utils/createJestConfig.js - this will just need to take paths.testsSetup and paths.appPackageJson as arguments.

I then think we should add a pathUtils module in react-dev-utils, containing resolveApp, getPublicUrl, getServedPath and resolveOwn. This should simplify config/paths.js quite a bit.

At this point, I think we should re-evaluate what else needs moving. If nobody objects, I'll start submitting pull requests for these changes.

Assignee
Assign to
Time tracking