UNPKG

@backstage/cli

Version:

CLI for developing Backstage plugins and apps

24 lines (17 loc) 737 B
'use strict'; function svgrTemplate({ imports, interfaces, componentName, props, jsx }, { tpl }) { const name = `${componentName.replace(/icon$/, "")}Icon`; const defaultExport = { type: "ExportDefaultDeclaration", declaration: { type: "Identifier", name } }; return tpl` ${imports} import SvgIcon from '@material-ui/core/SvgIcon'; console.log('DEPRECATION WARNING: The .icon.svg extension is deprecated, inline the SVG elements in a MUI SvgIcon instead.', Object.assign(new Error(), {name: 'Warning'}).stack); ${interfaces} const ${name} = (${props}) => React.createElement(SvgIcon, ${props}, ${jsx.children}); ${defaultExport}`; } exports.svgrTemplate = svgrTemplate; //# sourceMappingURL=svgrTemplate.cjs.js.map