code: function compile (config) {
    return new Promise((resolve, reject) => {
      webpack(config, (err, stats) => {
        if (err) {
          return reject(err)
        }
        if (stats.hasErrors()) {
          stats.toJson().errors.forEach(err => {
            console.error(err)
          })
          reject(new Error(`Failed to compile with errors.`))
          return
        }
        if (env.isDebug && stats.hasWarnings()) {
          stats.toJson().warnings.forEach(warning => {
            console.warn(warning)
          })
        }
        resolve(stats.toJson({ modules: false }))
      })
    })
  }
docs: Compile a webpack application and return stats json.
  
  @param {Object} config
  @returns {Promise<Object>}