index.js
function guessAppName (compilerWorkingDirectory) {
  var packageJson = path.resolve(compilerWorkingDirectory, 'package.json');
  if (!fs.existsSync(packageJson)) {
    packageJson = path.resolve(compilerWorkingDirectory, '../package.json');
    if (!fs.existsSync(packageJson)) {
      return 'Webpack App';
    }
  }
  return JSON.parse(fs.readFileSync(packageJson)).name;
}
function guessAppName (compilerWorkingDirectory) {
  var packageJson = path.resolve(compilerWorkingDirectory, 'package.json');
  if (!fs.existsSync(packageJson)) {
    packageJson = path.resolve(compilerWorkingDirectory, '../package.json');
    if (!fs.existsSync(packageJson)) {
      return 'Webpack App';
    }
  }
  return JSON.parse(fs.readFileSync(packageJson)).name;
}
function guessAppName ( compilerWorkingDirectory ) { var packageJson = path . resolve ( compilerWorkingDirectory , 'package.json' ) ; if ( ! fs . existsSync ( packageJson ) ) { packageJson = path . resolve ( compilerWorkingDirectory , '../package.json' ) ; if ( ! fs . existsSync ( packageJson ) ) { return 'Webpack App' ; } } return JSON . parse ( fs . readFileSync ( packageJson ) ) . name ; }
Tries to guess the name from the package.json
Tries to guess the name from the package . json