How can I change the name of the _nuxt folder?

Viewed 4941

Hello I've got an issue with a Nuxt.js app that I can't seem to resolve. What I want to do is to change the name of the generated _nuxt folder with some other name. So far I've updated the nuxt.config.js and added this snippet:

build: { publicPath: '/new-folder' },

as far as I understand this publicPath variable expects a CDN link so probably this is not the correct way of changing the default _nuxt folder name.

I have also tried adding the buildDir: 'new-folder but when I run the build command it doesn't show up in the project. No matter what changes I added in the nuxt.config file when I deployed it on heroku all the assets where still in the _nuxt folder which causes issues to my project. Am I not seeing something am I doing something wrong?

2 Answers

Since the default answer in nuxt JS Documentation is /_nuxt/. The correct answer should be /yourCustomName/ - be ware that you need two forward slash.

In nuxt.config.js

build: {
  publicPath: '/customName/'
}
Related