serve icon indicating copy to clipboard operation
serve copied to clipboard

Support serving from virtual directory

Open Alxandr opened this issue 6 years ago • 2 comments

I have an application that has to be mounted from a virtual directory with a given name. Today I solve this by manually creating that directory after build, and moving all build artifacts into it (example: make dir blog, and move build/* into it, then serve from .). It would be great if I could configure serve to serve a folder from localhost:8080/virtual/path.

Alxandr avatar Jan 16 '19 12:01 Alxandr

In need of exactly this! I have a homepage path set in my package.json and serving my CRA build locally requires me to manually create the folder structure 🤕

sami616 avatar Jan 24 '19 17:01 sami616

I found that the following works:

  "rewrites": [
    {
      "source": "virtual/path/static/:gen/:type/:name",
      "destination": "/static/:gen/:type/:name"
    }
  ]

However, I have to put a bunch of rewrites to handle all cases, so it's a bit brittle. I could not get the following rewrite to work: virtual/path/static/:path* => /static/:path.

Alxandr avatar Jan 28 '19 08:01 Alxandr