on-internet
← Community

How to build Nuxt 4 static SPA once and deploy under any sub-path (no per-path rebuild)?

Stack Overflow ·

I have a client-only Nuxt 4 app (ssr: false) that I build once with nuxt generate and distribute as a ZIP (the contents of .output/public). When unpacking it on a custom Apache server the app can end up at the web root or in any subfolder (/, /myapp/, /a/b/), sometimes next to other apps on the same server. Problem: In a sub-folder the page loads, but the browser requests /_nuxt/*.js from the server root. Apache answers with the SPA fallback (index.html), so I get: Loading module from "http://192.168.10.44/_nuxt/XXXX.js" was blocked because of a disallowed MIME type ("text/html"). Goal: One bu

Comments

Sign in or sign up to comment and upvote.

No comments yet.