Can I run vue-cli-service serve at non-root for testing purposes?

39 Views Asked by At

When I launch vue-cli-service serve for testing on my dev machine, it hosts my project at the root URL (i.e. "/") by default. I would like to launch vue-cli-service serve at a non-root path (i.e. "/test/") so I can test relative paths, redirects, environment variables, etc, before deploying out to our production server. Is there a way to launch vue-cli-service serve at a non-root path for testing purposes? Also, is this documented anywhere?

1

There are 1 best solutions below

0
moon On

Copy your build output dir(default dist) and paste in the dist ,so there will be two folder named dist(one is the child of the other), then rename the child
dist to test, hope it's helpful