UNPKG

cindy-ai-chatbot

Version:

An AI-powered chatbot component for React applications

24 lines (19 loc) 789 B
import { execSync } from 'child_process'; import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; // Get the directory name in ES modules const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // Ensure the lib directory exists const libDir = path.resolve(__dirname, '../src/lib'); if (!fs.existsSync(libDir)) { fs.mkdirSync(libDir, { recursive: true }); } // Run the copy-components script console.log('Copying components to lib directory...'); execSync('node scripts/copy-components.js', { stdio: 'inherit' }); // Run rollup to build the library console.log('Building library with rollup...'); execSync('rollup -c --bundleConfigAsCjs', { stdio: 'inherit' }); console.log('Library build completed successfully!');