The srcDir option is used to define the source directory of your Nuxt app. The default value of srcDir is the value of rootDir. You can change it as follows:
// nuxt.config.js
export default {
srcDir: 'src/'
}
Now, your app structure has become the following:
-| my-project/
---| node_modules/
---| src/
------| pages/
------| components/
------| ...
---| nuxt.config.js
---| package.json
Note that the Nuxt config file is outside the /src/ directory.
You can find an example app for this option in /chapter-2/configuration/srcDir/ in our GitHub repository.