Home Reference Source Test
import Package from 'amd-bundle/source/Package.js'
public class | source

Package

Package to be bundled

Test:

Constructor Summary

Public Constructor
public

constructor(path: string, includeAll: boolean, moduleMap: NameMap, noLog: boolean)

Member Summary

Public Members
public

The root path of this package (relative to process.cwd())

public get

Entry module of this package

public

Whether include NPM modules in the final bundle

public

Module count of this package

public
public get

Outside dependencies of this package

public

The entry file path of this package

public

Whether show logs during the bundle process

Method Summary

Public Methods
public
public

bundle(name: string): string

public

indexOf(module: Module | string): number

Protected Methods
protected

parse(modName: string)

protected

register(modName: string): Module

Public Constructors

public constructor(path: string, includeAll: boolean, moduleMap: NameMap, noLog: boolean) source

Params:

NameTypeAttributeDescription
path string

The entry file path of this package (relative to process.cwd())

includeAll boolean
  • optional
  • default: false

Include NPM modules in the final bundle

moduleMap NameMap
  • nullable: true

Map to replace some dependencies to others

noLog boolean
  • optional
  • default: false

Disable log output

Public Members

public base: string source

The root path of this package (relative to process.cwd())

public get entry: Module source

Entry module of this package

public includeAll: boolean source

Whether include NPM modules in the final bundle

public length: number source

Module count of this package

public moduleMap: NameMap source

public get outDependency: DependencyMap source

Outside dependencies of this package

public path: string source

The entry file path of this package

public showLog: boolean source

Whether show logs during the bundle process

Public Methods

public [Symbol.iterator](): * source

Return:

*

public bundle(name: string): string source

Params:

NameTypeAttributeDescription
name string
  • optional

Module name of bundled package (Default: The entry module's name)

Return:

string

Source code of this package

Test:

public indexOf(module: Module | string): number source

Params:

NameTypeAttributeDescription
module Module | string

Instance or name of a module

Return:

number

Protected Methods

protected parse(modName: string) source

Params:

NameTypeAttributeDescription
modName string

Path of a module

Test:

protected register(modName: string): Module source

Params:

NameTypeAttributeDescription
modName string

Path of a module

Return:

Module (nullable: true)

New module

Test: