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?
The . nuxt folder is part of the files needed to deploy your SSR application. It is not needed for deploying your static Nuxt app though because we use the dist folder for that. Edit this page on GitHub Updated at Wed, Oct 26, 2022.
Nuxt automatically generates the vue-router configuration for you, based on your provided Vue files inside the pages directory. That means you never have to write a router config again! Nuxt also gives you automatic code-splitting for all your routes.
Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in the browser. Server-side sends a fully rendered page to the client; the client's JavaScript bundle takes over which then allows the Vue. js app to hydrate .
The Nuxt. js PWA module registers a service worker for you to deal with offline caching. It automatically generates a manifest.json file. It automatically adds SEO friendly meta data with manifest integration. It automatically generates app icons with different sizes.
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/'
}
t's simple, just change in build the publicPath
.
buildDir is to change the folder for development, where the files will be when coding
nuxt.config.js:
build: {
publicPath: 'new-folder/',
},
in my case, my publicPath is leo/
you can check more about it here: https://medium.com/@andrejsabrickis/how-to-set-custom-configuration-for-nuxt-js-generate-task-5055e53c2da5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With