Repository URL to install this package:
|
Version:
1.2.10 ▾
|
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,
}
}