Home > @lynx-js/chunk-loading-webpack-plugin > ChunkLoadingWebpackPlugin

ChunkLoadingWebpackPlugin class

The ChunkLoadingWebpackPlugin enables chunk loading for webpack/Rspack in Lynx.

Signature:

export declare class ChunkLoadingWebpackPlugin 

Example 1

  • Use with Rspack.
// rspack.config.js
import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
export default {
  output: {
    chunkFormat: 'require',
  },
  plugins: [new ChunkLoadingWebpackPlugin()],
}

Example 2

  • Use with Webpack.
// webpack.config.js
import { ChunkLoadingWebpackPlugin } from '@lynx-js/chunk-loading-webpack-plugin'
export default {
  output: {
    chunkFormat: 'lynx',
  },
  plugins: [new ChunkLoadingWebpackPlugin()],
}

Constructors

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the ChunkLoadingWebpackPlugin class

Properties

PropertyModifiersTypeDescription
defaultOptionsstaticReadonly<Required<ChunkLoadingWebpackPluginOptions>>defaultOptions is the default options that the ChunkLoadingWebpackPlugin uses.

Methods

MethodModifiersDescription
apply(compiler)The entry point of a webpack plugin.