Static GitHub Issues

[2021] proposal: Add `sub directory` config in nuxt.config.js

prev: How to force a redirect to the 404 error page?
next: Routing Issue - Double Slash doesn't work

Hi, I maintain multiple Web sites with subdirectory structure created by Nuxt. (e.g. https://push7.jp/docs )

Then, I have a problem with such a site.

Nuxt build andgenerate are excellent, but they are always made to refer to the .nuxt directory for the root directory.

I solve this by linking with a shell script etc, but it is not a good idea.

To solve this problem, I would like to add a function that can manage the target directory with the configuration called subdirectory as Nuxt's function.

In particular, in Japan such a URL structure is very popular, so there are many opportunities to use.

If this proposal is allowed, I would like to implement it even soon!

Config sample

in nuxt.config.js

{
  ...
  subdirectory: Boolean | String
  ...
}
{
  ...
  subdirectory: false // default
  ...
}
{
  ...
  subdirectory: '/blog/'
  ...
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1795">#c1795</a>)</em></sub></div>