Options
All
  • Public
  • Public/Protected
  • All
Menu

Module \mmir-webpack\src\utils

Index

Type aliases

AppConfigUtils

AppConfigUtils: typeof appConfigUtils

Variables

Const dir

dir: string = __dirname

path

path: any = require('path')

Const reNormalize

reNormalize: RegExp = sep !== '/'? new RegExp(sep.replace(/\\/g, '\\\\'), 'g') : null

readUp

readUp: { sync: any }

semVer

semVer: { satisfies: any }

Const warn

warn: any = logUtils.warn

Const Export assignment webpackAppConfigUtils

webpackAppConfigUtils: WebpackAppConfigUtils = appConfigUtils as WebpackAppConfigUtils

Functions

checkPackageVersion

  • checkPackageVersion(packageId: string, versionRequirement: string): boolean | undefined

createWebWorkerLoaderConfig

  • createWebWorkerLoaderConfig(rootDir: string): { test: (path: string) => boolean; use: { loader: "worker-loader"; options: {} } }
  • Parameters

    • rootDir: string

    Returns { test: (path: string) => boolean; use: { loader: "worker-loader"; options: {} } }

    • test: (path: string) => boolean
        • (path: string): boolean
        • Parameters

          • path: string

          Returns boolean

    • use: { loader: "worker-loader"; options: {} }
      • loader: "worker-loader"
      • options: {}
        • [option: string]: any

doGetAbsolutePath

  • doGetAbsolutePath(ctxPath: string, list: string[], id: string): string

generateFromAppConfig

  • [description]

    Parameters

    • mmirAppConfig: WebpackAppConfig

      JSON-like configuration object: mmirAppConfig.config: module configuration object (analogous to requirejs module configuration) mmirAppConfig.paths: mapping of module names to file-paths (additional or overwriting implemenation of existing modules)

    Returns string

    stringified module code

getAbsolutePath

  • getAbsolutePath(compiler: any, mmirDir: string, id: string): string

getModId

  • getModId(_modPaths: {}, path: string, fileExtensions: RegExp, originalId: string): string

getPackageVersion

idFromPath

  • idFromPath(path: string): string

initPackageReader

  • initPackageReader(): typeof readUp

initSemVer

saveRequire

  • saveRequire(pkg: string): any

setOptionIf

  • setOptionIf(options: {}, optionNameIfTrue: string | null, optionNameIfFalse: string | null, value: any, useIfNone: boolean, packageId: string, packageVersionRequirement: string): {}
  • HELPER for setting option-values to different option-names, depending on the package version

    Parameters

    • options: {}

      the options object (INOUT parameter)

      • [options: string]: any
    • optionNameIfTrue: string | null

      the option name in case packageVersionRequirement evaluates to true (if null and the version is matching, then the option will be omitted)

    • optionNameIfFalse: string | null

      the option name in case packageVersionRequirement evaluates to false (if null and the version is not matching, then the option will be omitted)

    • value: any

      the option value

    • useIfNone: boolean

      the option-name to use, in case the version could not be determined (i.e. true for optionNameIfTrue, false for optionNameIfFalse)

    • packageId: string

      the package ID, e.g. "worker-loader"

    • packageVersionRequirement: string

      the requirement for the package version (according to sem-ver.satisfy()), e.g. ">= 3.0.0"

    Returns {}

    the options

    • [options: string]: any

Generated using TypeDoc