message: chore(fix memory leaks when bulid): fix memory leaks when bulid
diff: @@ -121,26 +121,25 @@ function build(builds) {
  let built = 0
  const total = builds.length
  const next = () => {
  - buildEntry(builds[built]).then(() => {
  + buildEntry(builds[built], () => {
  + builds[built-1] = null
  built++
  if (built < total) {
  next()
  }
  - }).catch(logError)
  + })
  }
  -
  next()
  }
  -function buildEntry(config) {
  +function buildEntry(config, next) {
  const isProd = /min\.js$/.test(config.output.file)
  - return rollup.rollup(config).then((bundle) => {
  - return new Promise((resolve, reject) => {
  + rollup.rollup(config).then((bundle) => {
  bundle.write(config.output).then((output) => {
  const code = output.code
  function report(extra) {
  console.log(blue(path.relative(process.cwd(), config.output.file)) + ' ' + getSize(code) + (extra || ''))
  - resolve()
  + next()
  }
  if (isProd) {
  zlib.gzip(code, (err, zipped) => {
  @@ -151,7 +150,6 @@ function buildEntry(config) {
  report()
  }
  })
  - })
  }).catch(logError)
  }
  