skyrpex / laravel-nuxt-js

Build a SPA with Laravel and Nuxt.
https://www.npmjs.com/package/laravel-nuxt
MIT License
146 stars 20 forks source link

Can I change nuxt dir? #12

Closed yuta0801 closed 5 years ago

yuta0801 commented 5 years ago

It is redundant to put nuxt's development directory under laravel resources, especially in projects where the front-end (nuxt) and back-end (laravel) teams are separate.

How can I change nuxt dir path? Thank you

davidjr82 commented 5 years ago

If using nuxt v2, ya can do this in nuxt.config.js:

require('dotenv').config();

module.exports = {
  mode: 'spa',

  srcDir: __dirname,

  generate: {
    dir: "public/spa",
  },

  router: {
    // base: '/spa/',
  },
...

Hope this helps

yuta0801 commented 5 years ago

Thank you for your help. but when I run laravel-nuxt dev, it has error [laravel] Could not open input file: artisan

My project file tree:

ProjectDir
├── laravel
│   ├── app
│   └── ...
└── nuxt
    └── pages
skyrpex commented 5 years ago

I guess the problem is solved with the laravelPath option, right?