3

First post.

I'm currently building a Laravel Nova application. I'm making changes to the dashboard component - more specifically the file within the "resources/js/views/Dashboard.vue".

I'm struggling to build the component - does anyone know how to build the component? I have some code which runs webpack.mix to build my JS and SCSS files, but I'm pretty sure it doesn't include the files within the Laravel Nova instance.

Any help will be great.

EXTRA:

I've already tried run the webpack command to build from inside the Laravel Nova instance but it errors out.

Venki WAR
  • 1,997
  • 4
  • 25
  • 38
Tom Hemus
  • 125
  • 2
  • 8

2 Answers2

7

UPDATE

I found renaming my webpack.mix.js.dist to webpack.mix.js, running npm run dev whilst within the ./nova directory worked... but only after running php artisan nova:publish

I've wrote a command to compile all these steps but do I have to run php artisan nova:publish everytime, just seems...tedious?

Tom Hemus
  • 125
  • 2
  • 8
5

By default, Nova's JavaScript is compiled for production. As such, you will not be able to access the Vue DevTools out of the box without compiling Nova's JavaScript for development. To accomplish this, you may use the following terminal commands from the root of your Nova project:

cd ./vendor/laravel/nova
mv webpack.mix.js.dist webpack.mix.js
npm install
npm run dev
rm -rf node_modules
cd -
php artisan nova:publish

Details: https://nova.laravel.com/docs/2.0/customization/frontend.html#vue-devtools