Have you gone through all the vite documentation?
Also there is this course here: https://laracasts.com/series/laravel-and-vite
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey there, I am new to Laravel and looked at a few tutorials and are half way through the 30 day course that is provided. I am very happy that I ran into this since I am new to web dev and didn't use a framework before. Anyways. What I wanted to ask, I saw that the js scripts are "build" from the resources folder into the public/build/assets folder and I wanted to ask how I could add mine. Since I have a game that I want to transfer to the framework (a kind of quiz game) and I don't want to have people check on the js script or modify it easily to get solutions. I saw that it gets rewriten and it is hard to understand what happens in the app script when don't have the "clean" version.
Is there a way I can include mine in there ? I tried to just move them in there and tried to re run the npm run build command in the terminal but it only build the app.js and the app.css again.
Anybody knows how I can solve my problem?
@bengeljo Basically there are two ways to import your custom script files to the build.
Import your custom css and js within the app.js/app.css
@import "./your_css.css" or import "./your_js.js"
If your files are working as individual then specify it's within the vite.config.js
input: [
'resources/css/app.css',
'resources/js/app.js',
'resources/css/your_custom.css',
'resources/js/your_custom.js',
],
Please or to participate in this conversation.