vue-cli-plugin-prerender-spa icon indicating copy to clipboard operation
vue-cli-plugin-prerender-spa copied to clipboard

Now (Zeit.co) config

Open sergeyfilimonov opened this issue 5 years ago • 1 comments

I am using vue-cli and deploy my app on Now and experiencing the known problem when all regular SPA routes stop working as index.html is changed. But I don't know how to configure routing all regular routes to app.html on Now.

To see what I am talking about go to https://clubedmarketru-sfilimonov.netology-group.now.sh and click "Войти" at the top right corner.

My vue.config.js file

module.exports = {
  pluginOptions: {
    prerenderSpa: {
      registry: undefined,
      renderRoutes: [
        '/'
      ],
      useRenderEvent: true,
      headless: true,
      onlyProduction: true
    }
  }
}

now.json:

{
   "name": "project",
   "version": 2,
   "github": {
     "enabled": false
   },
   "builds": [
     {
       "src": "dist/**",
       "use": "@now/static"
     }
   ],
   "routes": [
     {
       "src": "/(js|css|img|fonts|images|docs)/(.*)",
       "dest": "/dist/$1/$2"
     },
     {
       "src": "/favicon.ico",
       "dest": "/dist/favicon.ico"
     },
     {
       "src": "/robots.txt",
       "dest": "/dist/robots.txt"
     },
     {
       "src": "/(.*)",
       "dest": "/dist"
     }
   ]
 }

Can anybody help me with this? Thanks!

sergeyfilimonov avatar Oct 07 '19 14:10 sergeyfilimonov

Did you solve your issue?

ricky11 avatar Dec 22 '20 09:12 ricky11