Vite will not rollup scripts referenced only in Blade components
I have a Blade component that relies on some JavaScript, which I’ve put into a standalone module. The only place I need this script is when I’m using the component, so I’ve removed any mention of it from my main script file. This was working fine using the development server (npm run dev
.) However, when I compile my assets for production (npm run build
) I get an empty file generated.