message: Check for essential build artifacts from Angular CLI
diff: @@ -5,10 +5,17 @@ const pjson = require('./../../package.json')
  const colors = require('colors/safe')
  const logger = require('../logger')
  const portscanner = require('portscanner')
  +const path = require('path')
  +const fs = require('fs-extra')
  const validatePreconditions = async ({ exitOnFailure = true } = {}) => {
  let success = true
  success = checkIfRunningOnSupportedNodeVersion(process.version) && success
  + success = checkIfRequiredFileExists('../../frontend/dist/frontend/index.html') && success
  + success = checkIfRequiredFileExists('../../frontend/dist/frontend/main.js') && success
  + success = checkIfRequiredFileExists('../../frontend/dist/frontend/polyfills.js') && success
  + success = checkIfRequiredFileExists('../../frontend/dist/frontend/runtime.js') && success
  + success = checkIfRequiredFileExists('../../frontend/dist/frontend/vendor.js') && success
  const portSuccess = await checkIfPortIsAvailable(process.env.PORT || config.get('server.port'))
  if ((!success || !portSuccess) && exitOnFailure) {
  @@ -47,7 +54,17 @@ const checkIfPortIsAvailable = (port) => {
  })
  }
  +const checkIfRequiredFileExists = (filePath) => {
  + if (!fs.existsSync(path.resolve(__dirname, filePath))) {
  + logger.warn(`Required file ${colors.bold(filePath)} is missing (${colors.red('NOT OK')})`)
  + return false
  + }
  + logger.info(`Required file ${colors.bold(filePath)} is present (${colors.green('OK')})`)
  + return true
  +}
  +
  validatePreconditions.checkIfRunningOnSupportedNodeVersion = checkIfRunningOnSupportedNodeVersion
  validatePreconditions.checkIfPortIsAvailable = checkIfPortIsAvailable
  +validatePreconditions.checkIfRequiredFileExists = checkIfRequiredFileExists
  module.exports = validatePreconditions
  