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
  • Merge requests
  • !7259

feat(react-scripts): allow PUBLIC_URL in develoment mode

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/iamandrewluca/public-url-in-development into master Jun 21, 2019
  • Overview 60
  • Commits 1
  • Pipelines 0
  • Changes 14

Created by: iamandrewluca

Allow PUBLIC_URL in development mode

  • Feature (react-dev-utils/getPublicUrlOrPath)
  • Tests
  • Docs
  • Types DefinitelyTyped/DefinitelyTyped/pull/40982

Public API

  • In development mode browser is opened at desired pathname
  • Redirect to desired pathname if does not start with it (react-dev-utils/redirectServedPathMiddleware)
  • Assets will be served at desired pathname (webpack/webpack-dev-server/pull/2150)
  • If desired pathname is a relative path, app will be served at /

Private API

  • Combined paths.publicUrl and paths.servedPath into paths.publicUrlOrPath
  • Extracted all logic into react-dev-utils/getPublicUrlOrPath (no side effects)
  • Moved evalSourceMapMiddleware and errorOverlayMiddleware first in the middleware chain, redirect does not affect them.
  • Moved proxy middleware after redirect (this is the case what most want, proxy should respect PUBLIC_URL
  • Adapted noopServiceWorkerMiddleware to serve from servedPath
  • Updated webpack-dev-server@3.9.0 to webpack-dev-server@3.10.0

Blocked by webpack/webpack-dev-server/pull/2150 Blocked by webpack/webpack-dev-server/pull/2374 Blocked by https://github.com/webpack/webpack-dev-server new patch release

Closes #6280
Closes #6135 (closed)
Closes #4158

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/iamandrewluca/public-url-in-development