Moving `content` directory under `src/`
Hi, total newbie to the Nuxt ecosystem.
I am trying out the default project template, and am struggling to find a way to effectively move the
content
folder under src/
.
I thought that setting the srcDir
property would be enough, but it seems that content
is unaffected by that.
Is this achievable or not as of Nuxt 3?
3 Replies
Hi @Big Iron. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, I can answer your question about moving the
content
directory under src/
in Nuxt 3.
In Nuxt 3, the content
directory is typically located at the root of your project, parallel to the src
(or app
) directory. Moving it under src/
is not the standard configuration, and it's not directly affected by the srcDir
setting.
According to the Nuxt Content documentation, the default location for the content
directory is at the project root. The srcDir
setting primarily affects other directories like pages
, components
, etc., but not the content
directory.
However, if you really need to change the location of the content
directory, you can do so by configuring the Nuxt Content module in your nuxt.config.ts
file. Here's how you can achieve this:
This configuration tells Nuxt Content to look for the content
directory inside the src
folder.
It's worth noting that changing the default structure might lead to unexpected behavior or conflicts with other modules or configurations. The Nuxt team recommends sticking to the default directory structure unless absolutely necessary.
If you're new to Nuxt, it's generally best to follow the standard project structure as outlined in the Nuxt documentation. This will ensure compatibility with most Nuxt features and modules, and make it easier to follow tutorials and community resources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@512207378889048066> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Vue: Object literal may only specify known properties, and sources does not exist in type Partial<ModuleOptions>
No, that's definitely not a thing.