Closed the-programmer-alex closed 1 year ago
My package.json script
"build": "vite build",
"deploy": "yarn run build && php please ssg:generate && yarn run copy-build ",
"copy-build": "cp -r public/build/ storage/app/static/"
You need to specify that you want the public/build
directory to be copied over, otherwise it won't do it.
https://github.com/statamic/ssg/blob/master/config/ssg.php#L41
By default, vite compiles css/js into /public/build.
Build Vite for prod
When running
php please ssg:generate
the storage/app/static contains doesn't contain vite's build folder. Which then means the css/js won't link.Notice how it's trying to find the /build/assets folder? The very one that doesn't exist. Now the solution is to copy the
/build
folder afterwards, but that will mess people who don't know up. Especially since vite is default for Laravel 9+Versions