mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-19 04:49:22 +01:00
* init new react package project * setup react package * Fix config for build * update package * Fix build * update package * fix package.json * refactor and cleanup * bumb beta version * fix regex * bump version * Add hashing * Add tests * bump version * Add peer dependecies * Add docs * Add readme link
24 lines
684 B
JavaScript
24 lines
684 B
JavaScript
import path from 'path';
|
|
|
|
import { toPascalCase, resetFile, appendFile } from '../helpers';
|
|
|
|
export default function(inputEntry, outputDirectory, iconNodes) {
|
|
const fileName = path.basename(inputEntry);
|
|
|
|
// Reset file
|
|
resetFile(fileName, outputDirectory);
|
|
|
|
const icons = Object.keys(iconNodes);
|
|
|
|
// Generate Import for Icon VNodes
|
|
icons.forEach(iconName => {
|
|
const componentName = toPascalCase(iconName);
|
|
const importString = `export { default as ${componentName} } from './${iconName}';\n`;
|
|
appendFile(importString, fileName, outputDirectory);
|
|
});
|
|
|
|
appendFile('\n', fileName, outputDirectory);
|
|
|
|
console.log(`Successfully generated ${fileName} file`);
|
|
}
|