Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/bs / src / bundle / buildWithStats.ts
Size: Mime:
import webpack from 'webpack'
import configs from './webpack.config.js'

const compiler = webpack(configs)
const ENV_INFRA = process.env.CI !== undefined

console.log('begining the build...')
compiler.run((compilationError, stats) => {
  if (compilationError) {
    throw compilationError
    // console.error(compilationError)
    // return
  }

  if (ENV_INFRA) {
    console.log('minimal logs for CI')
  } else {
    const json = stats.toJson({
      reasons: true,
      errors: true,
      modules: true,
      exclude: true,
      chunks: true,
      verbose: true,
      debug: true,
      providedExports: false,
      usedExports: true,
      maxModules: 1000,
    })

    require('fliplog')
      .json(json)
      .bold('STATS')
      .echo()
    console.log(stats.toString({ colors: true }))
  }
})