In the vite.config.js file, you have this basic content.
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/js/another_js_file.js', ...], // HERE
refresh: true,
}),
tailwindcss(),
],
});
If you need to add more JS files, just add them to the table (value of the input parameter for the laravel function).
You can also import your other script inside the app.js file (like you showed in your post), this way you don't have to declare it inside the vite.config.js file.