Getting my statically generated site to run locally with no local server #10146
Unanswered
CodyBontecou
asked this question in
Questions (Nuxt 2)
Replies: 3 comments 11 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm starting to think this isn't a supported feature within the framework? |
Beta Was this translation helpful? Give feedback.
9 replies
-
In case anyone finds themselves facing this problem, I was able to get this working for my use-case (similar to @CodyBontecou's) by making a few tweaks to nuxt.config.js mode: 'spa', // Run Nuxt as a single page app
generate: {
fallback: 'index.html' // Always fall back to index.html
},
router: {
mode: 'hash', // Hash routes for page changes
base: './' // Use local paths for all assets
} I also had to go through my code and switch out a few absolute paths for relative ones. After that it was working great! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've ran
nuxt generate
and have the site generated. I can then serve mydist/
directory within a local server and it runs fine.But, I want to be able to browse the site locally by simply clicking the index.html.
Each page works currently. The issue is none of the navigation is working. I set up the links using NuxtLink.
EDIT: Please read my post below for further explanation of the issue I am trying to solve.
Beta Was this translation helpful? Give feedback.
All reactions