# Class SubAppWebpackPlugin

This plugin will look for `declareSubApp` calls and do these:

1. instruct webpack to name the dynamic import bundle as `subapp-<name>`
2. collect the subapp meta info and save them as `subapps.json`

- Defined in plugins/subapp-plugin.ts:143

#####
Index

### Constructors

constructor

### Properties

_assetsFile
_declareApiNames
_makeIdentifierBEE
_subApps
_tapAssets
_webpackMajorVersion

### Methods

_applyHmrInject
apply
findImportCall
initWebpackVer4
initWebpackVer5
updateAssets

## Constructors

### constructor

- new SubAppWebpackPlugin(options?): SubAppWebpackPlugin

- #### Parameters

  - options: {
    assetsFile?: string;
    declareApiName?: string | string[];
    webpackVersion?: number;
    } = {}

    subapp plugin options

    - ##### `Optional` assetsFile?: string

      Filename to output the subapp assets JSON file default: `subapps.json`

    - ##### `Optional` declareApiName?: string | string[]

      The API names for declaring subapp and components

    - ##### `Optional` webpackVersion?: number

      Webpack version (4, 5, etc)

      minimum 4

  #### Returns SubAppWebpackPlugin

  - Defined in plugins/subapp-plugin.ts:155

## Properties

### _assetsFile

_assetsFile: string

- Defined in plugins/subapp-plugin.ts:149

### _declareApiNames

_declareApiNames: string[]

- Defined in plugins/subapp-plugin.ts:144

### _makeIdentifierBEE

_makeIdentifierBEE: Function

- Defined in plugins/subapp-plugin.ts:147

### _subApps

_subApps: Record<string, any>

- Defined in plugins/subapp-plugin.ts:145

### _tapAssets

_tapAssets: Function

- Defined in plugins/subapp-plugin.ts:148

### _webpackMajorVersion

_webpackMajorVersion: number

- Defined in plugins/subapp-plugin.ts:146

## Methods

### _applyHmrInject

- _applyHmrInject(compiler): void

- #### Parameters

  - compiler: any

  #### Returns void

  - Defined in plugins/subapp-plugin.ts:261

### apply

- apply(compiler): void

- #### Parameters

  - compiler: any

  #### Returns void

  - Defined in plugins/subapp-plugin.ts:272

### findImportCall

- findImportCall(ast): any

- #### Parameters

  - ast: any

  #### Returns any

  - Defined in plugins/subapp-plugin.ts:241

### initWebpackVer4

- initWebpackVer4(): {
  BasicEvaluatedExpression: any;
  makeIdentifierBEE: ((expr) => any);
  tapAssets: ((compiler) => void);
  }

- #### Returns {
  BasicEvaluatedExpression: any;
  makeIdentifierBEE: ((expr) => any);
  tapAssets: ((compiler) => void);
  }

  - ##### BasicEvaluatedExpression: any

  - ##### makeIdentifierBEE: ((expr) => any)

    - - (expr): any

      - #### Parameters

        - expr: any

        #### Returns any

  - ##### tapAssets: ((compiler) => void)

    - - (compiler): void

      - #### Parameters

        - compiler: any

        #### Returns void

  - Defined in plugins/subapp-plugin.ts:187

### initWebpackVer5

- initWebpackVer5(): {
  BasicEvaluatedExpression: any;
  makeIdentifierBEE: ((expr) => any);
  tapAssets: ((compiler) => void);
  }

- #### Returns {
  BasicEvaluatedExpression: any;
  makeIdentifierBEE: ((expr) => any);
  tapAssets: ((compiler) => void);
  }

  - ##### BasicEvaluatedExpression: any

  - ##### makeIdentifierBEE: ((expr) => any)

    - - (expr): any

      - #### Parameters

        - expr: any

        #### Returns any

  - ##### tapAssets: ((compiler) => void)

    - - (compiler): void

      - #### Parameters

        - compiler: any

        #### Returns void

  - Defined in plugins/subapp-plugin.ts:200

### updateAssets

- updateAssets(assets): void

- #### Parameters

  - assets: any

  #### Returns void

  - Defined in plugins/subapp-plugin.ts:218