Vite on Forge Currently, I am unable to get Vite to load from the build folder when on Forge. Localhost development is running OK. I have updated the deployment script to include npm install && npm build for forge.
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Website</title>
<link rel="preload" as="style" href="/build/assets/app-04215b4b.css" /><link rel="modulepreload" href="/build/assets/app-7b1d0e0b.js" /><link rel="stylesheet" href="/build/assets/app-04215b4b.css" /><script type="module" src="/build/assets/app-7b1d0e0b.js"></script> <script defer src="https://unpkg.com/[email protected] /dist/cdn.min.js"></script>
<meta name="csrf-token" content="ctfOgwwEUnNVAtk3oVNrmE5iBJKvE4tdY8m3xOFB">
</head>
The above on localhost.
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Website</title>
<script type="module" src="http://127.0.0.1:5176/@vite/client"></script><script type="module" src="http://127.0.0.1:5176/resources/js/app.js"></script> <script defer src="https://unpkg.com/[email protected] /dist/cdn.min.js"></script>
</head>
The above on Forge.
Below is my deploy script.
cd /home/forge/stars.my
git pull -f origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
if [ -f artisan ]; then
$FORGE_PHP artisan migrate --force
fi
npm install
npm run build
@afeezaziz Is there a reason you're running builds.etc. AFTER the site is back up?
Please sign in or create an account to participate in this conversation.