All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.scripts.cleanDistExports.js Maven / Gradle / Ivy

Go to download

This library provides a set of common React components for use with the PatternFly reference implementation.

The newest version!
const fs = require('fs');
const path = require('path');

const distIndexFiles = ['esm', 'js'].map((dir) => path.join(process.cwd(), 'dist', dir, 'index.js'));
const distIndexDeclarationFiles = ['esm', 'js'].map((dir) => path.join(process.cwd(), 'dist', dir, 'index.d.ts'));

[...distIndexFiles, ...distIndexDeclarationFiles].forEach((file) => {
  const fileContents = fs.readFileSync(file, 'utf8');
  const newFileContents = fileContents
    .split('\n')
    .filter((line) => !line.includes('demos'))
    .join('\n');
  fs.writeFileSync(file, newFileContents);
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy