typescript-bundle icon indicating copy to clipboard operation
typescript-bundle copied to clipboard

Feature request: exportEachAs option

Open kylemh opened this issue 5 years ago • 0 comments
trafficstars

I'm making a React SVG icon library which uses rollup and the react-svg-loader to automatically resolve SVG imports into a ready-to-go React SVG component. The module mapper file looks like this:

import { ReactSVGElement } from 'react';

const _Icon: ReactSVGElement = require('./svgs/some-icon.svg');
// dozens more

export {
  _Icon as Icon,
  // dozens more
};

I hate all these extra steps to properly export each icon a typesafe ReactSVGElement. I would love to use your bundler to export everything as the same type, but not as one module - I want to maintain the tree-shakeability.

kylemh avatar Jan 26 '20 06:01 kylemh