Skip to content

Compiling Assets (ViteJs)

Asep edited this page Oct 24, 2023 · 2 revisions

Make sure you have installed all package modules in all folders, if not you can run the command below.

php artisan module:npm --install

Running ViteJs

To run ViteJs you only need to execute one of the NPM scripts that is included with the default Ladmin package.json file

// Run ViteJs
$ npm run dev

// Run all ViteJs and minify output...
$ npm run build

After the asset version is created, you need to call it in the layout file that you have provided previously by:

<head>
    . . . 

    @vite([
        'Modules/Blog/Resources/js/blog.js',
        'Modules/Blog/Resources/css/blog.css'
    ])
    
    . . . 
</head>

For more info on Asset Bundling (Vite) view the documentation here: https://laravel.com/docs/master/vite