40 lines
1.7 KiB
Bash
Executable File
40 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "🚀 Setting up JavaScript dependencies for ShowerLoop website..."
|
|
|
|
# Create directories if they don't exist
|
|
mkdir -p static/js
|
|
mkdir -p static/css/vendor
|
|
mkdir -p static/webfonts
|
|
|
|
# Copy Material Design Lite
|
|
cp node_modules/material-design-lite/material.min.js static/js/ || echo "Warning: material.min.js not found"
|
|
cp node_modules/material-design-lite/material.min.css static/css/vendor/ || echo "Warning: material.min.css not found"
|
|
|
|
# Copy Font Awesome
|
|
cp node_modules/@fortawesome/fontawesome-free/css/all.min.css static/css/vendor/fontawesome.min.css || echo "Warning: fontawesome.min.css not found"
|
|
cp -r node_modules/@fortawesome/fontawesome-free/webfonts/* static/webfonts/ || echo "Warning: webfonts not found"
|
|
|
|
# Create directories for videos
|
|
mkdir -p static/videos
|
|
|
|
echo "Dependencies setup complete!"
|
|
|
|
# Step 1: Install npm dependencies with legacy-peer-deps flag to resolve conflicts
|
|
echo "📦 Installing npm dependencies..."
|
|
npm install --legacy-peer-deps --save-dev rollup@3.21.5 rollup-plugin-terser@7.0.2 @rollup/plugin-node-resolve@15.0.2 @rollup/plugin-commonjs@25.0.0 source-map-explorer@2.5.3
|
|
|
|
# Step 2: Build optimized JavaScript
|
|
echo "🔧 Building optimized JavaScript..."
|
|
npm run build:js || echo "Warning: JavaScript build failed, but continuing with setup"
|
|
|
|
# Step 3: Optimize JavaScript and CSS
|
|
echo "🔍 Optimizing JavaScript and CSS..."
|
|
./optimize-js.sh || echo "Warning: JavaScript optimization failed, but continuing with setup"
|
|
|
|
echo "✅ Setup complete! Your dependencies are now configured locally without CDN dependencies."
|
|
echo ""
|
|
echo "📋 Next steps:"
|
|
echo "1. Run './build-production.sh' to build the production site"
|
|
echo "2. Run 'npm run dev' to start the Hugo dev server" |