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 / scripts / bundle / fromBuildOptionsToParams.ts
Size: Mime:
import fwf from 'funwithflags'
import { resolveToRoot } from '../../config/resolveToRoot'
import { Options } from '../../typings'

export function fromBuildOptionsToParams(buildOptions: Options) {
  const { optimize, target } = buildOptions

  const isAnalyze = process.env.BUILD_ANALYZE

  // @note this checks whether --optimize || NODE_ENV = production
  const isProd = Boolean(optimize || process.env.NODE_ENV === 'production')

  const isDev = !isProd
  const isClient = target === 'client'
  const isServer = target === 'server'
  const isNode = !isClient

  const isProdClient = Boolean(isProd && isClient)
  const isProdServer = Boolean(isProd && isServer)
  const isDevClient = Boolean(isDev && isClient)
  const isDevServer = Boolean(isDev && isServer)

  return {
    ...buildOptions,
    isAnalyze,
    isDevClient,
    isProdServer,
    isProdClient,
    isDevServer,
    isProd,
    isDev,
    isClient,
    isServer,
    // ...FLAGS,
  }
}