function generateComponentIndex() {
    function generateSource(list) {
        const requires = list
            .map(
                name =>
                    `  '${name}': require('./components/prism-${name}.js').default`
            )
            .join(',\n');
        return moduleExport(`{\n${requires}\n};\n`);
    }

    fs.writeFileSync('./src/all-components.js', generateSource(LIST));
    fs.writeFileSync(
        './src/common-components.js',
        generateSource(LIST.filter(isCommon))
    );
}
/*
 * Generate a module exposing all components
 */
Generate a module exposing all components
Generate a module exposing all components
function generateComponentIndex() {
    function generateSource(list) {
        const requires = list
            .map(
                name =>
                    `  '${name}': require('./components/prism-${name}.js').default`
            )
            .join(',\n');
        return moduleExport(`{\n${requires}\n};\n`);
    }
    fs.writeFileSync('./src/all-components.js', generateSource(LIST));
    fs.writeFileSync(
        './src/common-components.js',
        generateSource(LIST.filter(isCommon))
    );
}
function generateComponentIndex ( ) { function generateSource ( list ) { const requires = list . map ( name => ` ${ name } ${ name } ` ) . join ( ',\n' ) ; return moduleExport ( ` \n ${ requires } \n \n ` ) ; } fs . writeFileSync ( './src/all-components.js' , generateSource ( LIST ) ) ; fs . writeFileSync ( './src/common-components.js' , generateSource ( LIST . filter ( isCommon ) ) ) ; }
Generate a module exposing all components
Generate a module exposing all components