webpack.config.js
function getExamples(dirName, callback) {
  const example_files = fs.readdirSync(dirName);
  const entries = {};

  // iterate through the list of files in the directory.
  for (const filename of example_files) {
    // ooo, javascript file!
    if (filename.endsWith('.js')) {
      // trim the entry name down to the file without the extension.
      const entry_name = filename.split('.')[0];
      callback(entry_name, path.join(dirName, filename));
    }
  }

  return entries;
}
function getExamples(dirName, callback) {
  const example_files = fs.readdirSync(dirName);
  const entries = {};

  // iterate through the list of files in the directory.
  for (const filename of example_files) {
    // ooo, javascript file!
    if (filename.endsWith('.js')) {
      // trim the entry name down to the file without the extension.
      const entry_name = filename.split('.')[0];
      callback(entry_name, path.join(dirName, filename));
    }
  }

  return entries;
}
function getExamples ( dirName , callback ) { const example_files = fs . readdirSync ( dirName ) ; const entries = { } ; // iterate through the list of files in the directory. for ( const filename of example_files ) { // ooo, javascript file! if ( filename . endsWith ( '.js' ) ) { // trim the entry name down to the file without the extension. const entry_name = filename . split ( '.' ) [ 0 ] ; callback ( entry_name , path . join ( dirName , filename ) ) ; } } return entries ; }
Get the list of examples from the example directory.

@param {String} dirName - Name of the directory to read.
@param {Function} callback - Function to execute for each example.

@returns {undefined} Nothing.
Get the list of examples from the example directory .