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 / bundlePaths.ts
Size: Mime:
/* eslint max-statements: "OFF" */
// const { getConfigForEnv } = require('../oneConfig/getConfigForEnv')

/**
 * @todo @james @fixme @important public path SHOULD be absolute as a non fully qualified domain name
 * @example /client/ > http://0.0.0:444/client/
 *
 * @param {any} bundlingOptions
 * @returns
 */
function getURLs(bundlingOptions) {
  // log.data(bundlingOptions).echo()

  const { isDev, isProd, isClient } = bundlingOptions

  /**
   * @deprecated this commented out way
   * will be tree shaken when static - we want this as dynamic
   *
   * @constant
   * @static
   * @example
   * const { bundleConfig } = bundlingOptions
   * const { host, port, clientDevServerPort } = bundlingOptions
   *
   * -------------
   * @event refactored |>>
   */
  // /server/??? not a web path....
  const webPath =
    isClient || isProd ? process.env.WEB_PATH || '/client/' : '/server/'

  // dev
  const outputPublicPath = process.env.BUNDLE_PUBLIC_PATH || '/'

  bundlingOptions.outputPublicPath = outputPublicPath
  bundlingOptions.webPath = webPath

  return {
    outputPublicPath,
    webPath,
  }
}

export { getURLs }
export default getURLs