How to use the @carbon/icons/build-info.json.length function in @carbon/icons

To help you get started, we’ve selected a few @carbon/icons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github carbon-design-system / carbon / packages / icons-vue / src / build.js View on Github external
async function build({ cwd }) {
  reporter.info(`Building components for ${meta.length} icons...`);
  const ESM_DIR = path.join(cwd, 'es');
  const BUNDLE_FORMATS = [
    {
      format: 'cjs',
      directory: 'lib',
    },
    {
      format: 'umd',
      directory: 'umd',
    },
  ];

  reporter.info('Building ESM and bundle sources...');
  await Promise.all(
    meta.map(async info => {
      const source = createModuleFromInfo(info);