Home Reference Source Test

Function

Static Public Summary
public

generate(pack: Package, name: string, entry: string, outside: DependencyMap): string

public
public
public
public

merge(base: string, path: string): string

This will be used in the bundled source

public

Static Public

public generate(pack: Package, name: string, entry: string, outside: DependencyMap): string source

import {generate} from 'amd-bundle/source/UMD.js'

Params:

NameTypeAttributeDescription
pack Package
name string

Module name of bundled package

entry string

Name of entry module (before bundling)

outside DependencyMap

Return:

string

Bundled source with UMD wrapper

Test:

public getNPMFile(name: string): string source

import {getNPMFile} from 'amd-bundle/source/utility.js'

Params:

NameTypeAttributeDescription
name string

Name of a module

Return:

string (nullable: true)

Valid name in ./node_modules/ is a JS or JSON file

Test:

public getNPMIndex(name: string): string source

import {getNPMIndex} from 'amd-bundle/source/utility.js'

Params:

NameTypeAttributeDescription
name string

Name of a module

Return:

string (nullable: true)

Valid name in ./node_modules/ is index.js or index.json

Test:

public getNPMPackage(name: string): string source

import {getNPMPackage} from 'amd-bundle/source/utility.js'

Params:

NameTypeAttributeDescription
name string

Name of a module

Return:

string (nullable: true)

Entry file path of an existing package.json

Test:

public merge(base: string, path: string): string source

import {merge} from 'amd-bundle/source/utility.js'

This will be used in the bundled source

Params:

NameTypeAttributeDescription
base string

Root path

path string

Path relative to base

Return:

string

Joined & normalized path

Test:

public outPackage(name: string): boolean source

import {outPackage} from 'amd-bundle/source/utility.js'

Params:

NameTypeAttributeDescription
name string

Name of a module

Return:

boolean

Whether name is a dependency out of this package

Test: