@moontra/moonui-pro
Version:
Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components
27 lines (21 loc) • 799 B
JavaScript
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Add 'use client' to the beginning of dist files
const files = ['dist/index.mjs', 'dist/index.js'];
files.forEach(file => {
const filePath = path.join(__dirname, '..', file);
if (fs.existsSync(filePath)) {
let content = fs.readFileSync(filePath, 'utf8');
if (!content.startsWith('"use client"') && !content.startsWith("'use client'")) {
content = '"use client";\n' + content;
fs.writeFileSync(filePath, content);
console.log(`✅ Added 'use client' to ${file}`);
} else {
console.log(`✔️ 'use client' already exists in ${file}`);
}
}
});