0

I'm trying to serve a local website using valet, but unsuccessfully.

vue create my-project
cd my-project

If I serve the project with:

npm run serve

I get the default page with Vue logo.

But if I serve the project using valet (with park or link option), I get a blank page.

How can I serve vue-cli project using valet ?

DevonDahon
  • 7,460
  • 6
  • 69
  • 114

1 Answers1

0

While this doesn't work with vue-cli-service serve, I have found a workaround that works with build.

You can serve static sites using this driver.

After installing the driver:

$ cd my-vue-project
$ yarn build

$ cd dist
$ touch static
$ valet link acme
$ mkdir public
$ mv ./* public

You can then view the built Vue site at http://acme.test. The downside is needing to rebuild everytime you make a change, but it works for testing when needed.

Cameron Wilby
  • 2,222
  • 1
  • 25
  • 35