-
Nuxt.js dir Configuration official document
-
Some files may not be created by default, such as the assets folder. Some versions do not provide this folder by default. If you need to use this folder, you have to manually create it. If a new folder name is assets, you do not need to add the configuration in nuxt.config.js. If a new folder name is assets, you need to add the corresponding configuration to make it take effect.
export default { dir: { assets: 'custom-assets', app: 'custom-app', layouts: 'custom-layouts', middleware: 'custom-middleware', pages: 'custom-pages', static: 'custom-static', store: 'custom-store' } } Copy the code
-
This is a new Nuxt project with no assets folder by default
-
Add assets folder and put an image to test. This folder name is default, so nuxt.config.js is not required.
-
If assets is changed to custom-assets, the nuxt.config.js configuration must be added. Otherwise, an error will be reported that the imported folder cannot be found.