marcomontalbano / figma-export

Export tool for Figma. You can easily and automatically export your Figma components and use them directly into your website.
https://figma-export.marcomontalbano.com
MIT License
259 stars 33 forks source link

Add 'getComponentFilename' property to output-components-as-svgr #123

Closed marcomontalbano closed 2 years ago

marcomontalbano commented 2 years ago
require('@figma-export/output-components-as-svgr')({
    output: './output',
    getDirname: (options) => `${options.pageName}${path.sep}${options.dirname}`,
    getComponentName: (options) => `${pascalCase(options.basename)}`,
+   getComponentFilename = (options): string => `${getComponentName(options)}`,
    getFileExtension: (options) => '.jsx',
    getSvgrConfig: (options) => ({}),
    getExportTemplate = (options): string => {
        const reactComponentName = getComponentName(options);
        const reactComponentFilename = `${getComponentFilename(options)}${getFileExtension(options)}`;
        return `export { default as ${reactComponentName} } from './${reactComponentFilename}';`;
    },
})

linked to #121