# 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 packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:8

#####
Index

### Constructors

constructor

### Properties

_assetsFile
_declareApiNames
_foundSubApps
_hasHmr
_makeIdentifierBEE
_subApps
_tapAssets
_webpackMajorVersion
findImportCall

### Methods

_applyHmrInject
apply
initWebpackVer5
updateAssets

## Constructors

### constructor

- new SubAppWebpackPlugin(options?): SubAppWebpackPlugin

- #### Parameters

  - `Optional` 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

      minimum 5

  #### Returns SubAppWebpackPlugin

  - Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:21

## Properties

### _assetsFile

_assetsFile: string

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:14

### _declareApiNames

_declareApiNames: string[]

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:9

### _foundSubApps

_foundSubApps: string

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:16

### _hasHmr

_hasHmr: ((compilation) => boolean)

#### Type declaration

- - (compilation): boolean

  - #### Parameters

    - compilation: any

    #### Returns boolean

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:15

### _makeIdentifierBEE

_makeIdentifierBEE: Function

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:12

### _subApps

_subApps: Record<string, any>

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:10

### _tapAssets

_tapAssets: Function

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:13

### _webpackMajorVersion

_webpackMajorVersion: number

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:11

### `Private` findImportCall

findImportCall: any

- Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:45

## Methods

### _applyHmrInject

- _applyHmrInject(compiler): void

- Webpack 5 Reference:

  - lib/HotModuleReplacementPlugin.js

  #### Parameters

  - compiler: any

  #### Returns void

  - Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:52

### apply

- apply(compiler): void

- #### Parameters

  - compiler: any

  #### Returns void

  - Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:53

### initWebpackVer5

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

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

  - ##### BasicEvaluatedExpression: any

  - ##### hasHmr: (() => boolean)

    - - (): boolean

      - #### Returns boolean

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

    - - (expr): any

      - #### Parameters

        - expr: any

        #### Returns any

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

    - - (compiler): void

      - #### Parameters

        - compiler: any

        #### Returns void

  - Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:38

### updateAssets

- updateAssets(assets): void

- #### Parameters

  - assets: any

  #### Returns void

  - Defined in packages/xarc-webpack/lib/plugins/subapp-plugin-webpack5.d.ts:44