The buildAssetsDir setting in nuxt.config.ts is helpful to know about, but ultimately there's an easier way to get around the underscores in the paths: tell Github pages to not run Jekyll.
If you place an empty .nojekyll file in the public directory and push to GitHub pages with gh-pages --dotfiles -d .output/public to include dotfiles, you can circumnavigate the need to rename the assets directory.
Additionally, newer versions of Nuxt have started adding a _payload.json that is not so easily renamed, so this workaround really only works for the _nuxt directory.
See this repo: https://github.com/darioTecchia/nuxt3-ghpages
The
buildAssetsDirsetting innuxt.config.tsis helpful to know about, but ultimately there's an easier way to get around the underscores in the paths: tell Github pages to not run Jekyll.If you place an empty
.nojekyllfile in thepublicdirectory and push to GitHub pages withgh-pages --dotfiles -d .output/publicto include dotfiles, you can circumnavigate the need to rename the assets directory.Additionally, newer versions of Nuxt have started adding a
_payload.jsonthat is not so easily renamed, so this workaround really only works for the_nuxtdirectory.See this repo: https://github.com/darioTecchia/nuxt3-ghpages