API: The srcDir Property

Define the source directory of your Nuxt.js application

Example (nuxt.config.js):

  1. export default {
  2. srcDir: 'client/'
  3. }

Then, your application structure can be:

  1. -| app/
  2. ---| node_modules/
  3. ---| client/
  4. ------| assets/
  5. ------| components/
  6. ------| layouts/
  7. ------| middleware/
  8. ------| pages/
  9. ------| plugins/
  10. ------| static/
  11. ------| store/
  12. ---| nuxt.config.js
  13. ---| package.json

This option is useful to have a custom server and using Nuxt.js, so all npm dependencies can be regrouped in one package.json.