5

I've read multiple articles and posts about the nuxt generate issues, but i couldn't find an answer. So I'm learning Vue & Nuxt. I've create a spa, and i'm trying to host it on my website (in a subfolder eg. http://mywebsite.com/subfolder/). It's a simple hosting website (shared server) so i'd like to generate a static website from my files.

I'm running nuxt generate , but when i move the dist folder generated in my subfolder, i'm getting erros :

GET http://mywebsite.com/_nuxt/5f51d97c56209053356b.js net::ERR_ABORTED 404 (Not Found)

Of course, the path should be

http://mywebsite.com/subfolder/_nuxt/5f51d97c56209053356b.js

How can i fix this? From what i've understand, i should add some lines in my nuxt.config.js file right? I've tried multiple combinations, but i can't make it work..

1 Answer 1

6

Allright so this was simple, i've finally found the answer in the docs. I've simply added in my nuxt.config.js file the following :

router: {
    base: '/subfolder/'
  }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.