Home

Issue: 2021

proposal: Add `sub directory` config in nuxt.config.js

[issue link]

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/'
  ...
}
This question is available on Nuxt.js community (#c1795)