Update scripts/remove-cdn-for-vercel.js
This commit is contained in:
parent
cd8f2434bf
commit
2be4e996fe
|
|
@ -8,8 +8,7 @@ const fs = require('fs');
|
|||
const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
console.log('
|
||||
🔧 [PREBUILD] Starting Vercel preparation script...');
|
||||
console.log('\n🔧 [PREBUILD] Starting Vercel preparation script...');
|
||||
console.log('📋 Environment:', {
|
||||
VERCEL: process.env.VERCEL,
|
||||
NEXT_PUBLIC_VERCEL: process.env.NEXT_PUBLIC_VERCEL,
|
||||
|
|
@ -18,8 +17,7 @@ console.log('📋 Environment:', {
|
|||
|
||||
// Seulement sur Vercel
|
||||
if (process.env.VERCEL === '1' || process.env.NEXT_PUBLIC_VERCEL === '1') {
|
||||
console.log('✅ Running on Vercel - preparing for build...
|
||||
');
|
||||
console.log('✅ Running on Vercel - preparing for build...\n');
|
||||
|
||||
// Install Tailwind CSS v4 for Vercel build (per official docs)
|
||||
console.log('📦 Installing Tailwind CSS v4 packages...');
|
||||
|
|
@ -29,8 +27,7 @@ if (process.env.VERCEL === '1' || process.env.NEXT_PUBLIC_VERCEL === '1') {
|
|||
execSync('npm install tailwindcss @tailwindcss/postcss postcss --legacy-peer-deps', {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
console.log('✅ Tailwind CSS v4 installed with lightningcss bindings
|
||||
');
|
||||
console.log('✅ Tailwind CSS v4 installed with lightningcss bindings\n');
|
||||
} catch (error) {
|
||||
console.error('❌ Failed to install Tailwind CSS:', error.message);
|
||||
process.exit(1);
|
||||
|
|
@ -63,23 +60,17 @@ export function TailwindCDNLoader() {
|
|||
fs.writeFileSync(loaderPath, emptyComponent);
|
||||
const newSize = emptyComponent.length;
|
||||
|
||||
console.log('
|
||||
📊 Results:');
|
||||
console.log('\n📊 Results:');
|
||||
console.log(' - Original size:', originalSize, 'bytes');
|
||||
console.log(' - New size:', newSize, 'bytes');
|
||||
console.log(' - Removed:', originalSize - newSize, 'bytes');
|
||||
console.log('
|
||||
✅ SUCCESS! CDN code removed from tailwind-cdn-loader.tsx');
|
||||
console.log('🚀 Vercel build will use compiled Tailwind v4 (no CDN)
|
||||
');
|
||||
console.log('\n✅ SUCCESS! CDN code removed from tailwind-cdn-loader.tsx');
|
||||
console.log('🚀 Vercel build will use compiled Tailwind v4 (no CDN)\n');
|
||||
} catch (error) {
|
||||
console.log('
|
||||
❌ ERROR:', error.message);
|
||||
console.log(' Build will continue but CDN might be present
|
||||
');
|
||||
console.log('\n❌ ERROR:', error.message);
|
||||
console.log(' Build will continue but CDN might be present\n');
|
||||
}
|
||||
} else {
|
||||
console.log('⏭️ Not on Vercel - skipping CDN removal');
|
||||
console.log(' (CDN will be used for CodeSandbox development)
|
||||
');
|
||||
console.log(' (CDN will be used for CodeSandbox development)\n');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue