26 lines
1.1 KiB
Bash
26 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# exit when any command fails
|
|
set -e
|
|
|
|
# init nvm
|
|
\. $NVM_DIR/nvm.sh
|
|
|
|
if [ ! -f /var/www/html/artisan ]; then
|
|
echo "No existing Laravel project found"
|
|
composer create-project laravel/laravel /var/www/html "$LARAVEL_VERSION"
|
|
npm install -D tailwindcss postcss autoprefixer --prefix /var/www/html
|
|
sed -i "/export default defineConfig({/a\ server: {host: '0.0.0.0'}," /var/www/html/vite.config.js
|
|
echo -e "@tailwind base;\n@tailwind components;\n@tailwind utilities;" >> /var/www/html/resources/css/app.css
|
|
echo -e '/** @type {import('tailwindcss').Config} */\nmodule.exports = {\n content: [\n "./resources/**/*.blade.php",\n "./resources/**/*.js",\n "./resources/**/*.vue",\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n}' > /var/www/html/tailwind.config.js
|
|
npx tailwindcss init -p
|
|
fi
|
|
|
|
if [[ "$AUTO_START_NPM_DEV" = true ]]; then
|
|
echo "Staring npm dev"
|
|
npm run dev --prefix /var/www/html &
|
|
fi
|
|
|
|
echo "Staring Laravel"
|
|
php /var/www/html/artisan serve --host=0.0.0.0 --port=8080
|