mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 17:57:43 +01:00
* New setup for new NPM package * Add build scripts for dist * Add introduction readme * Refactor names * update package.json * remove log * rename variable * Factoring * Improve optimize script * Add eslint config * Eslint fixes * rename import * Move packeges * Setup rollup and build progress * Refactor scripts * fix lint error * remove lint disabler * Bring back old libraries * add indentation * reset packages directory * remove vscode setting files * 0.1.0-alpha.0 * new version * 0.1.0-alpha.1 * Fix build process * Add create element to the entry file * update version number * publish new alhpa version * fixing bugs * Add jest and tests * replace with XML createElement * set new version * Fix svg generation * Add tests for main library * Update docs * Adjust tests and selectors * update the spec * Update README.md * Update README.md * Update README.md * update version * Update README.md * Move function to helpers file * rename license, package and readme * Fix build files * rename packages Co-authored-by: Eric Fennis <eric.fennis@endurance.com>
24 lines
719 B
JavaScript
24 lines
719 B
JavaScript
import path from 'path';
|
|
|
|
import { generateComponentName, resetFile, appendFile } from '../helpers';
|
|
|
|
export default function(inputEntry, outputDirectory, componentGetter, 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 = generateComponentName(iconName);
|
|
const importString = `export { default as ${componentName} } from './${iconName}';\n`;
|
|
appendFile(importString, fileName, outputDirectory);
|
|
});
|
|
|
|
appendFile('\n', fileName, outputDirectory);
|
|
|
|
console.log(`Successfully generated ${fileName} file`);
|
|
}
|