这是开发预览网站。请访问正式文档 lynxjs.org

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

Constructor

Modifiers

Description

(constructor)(options)

Constructs a new instance of the ChunkLoadingWebpackPlugin class

Properties

Property

Modifiers

Type

Description

defaultOptions

static

Readonly<Required<ChunkLoadingWebpackPluginOptions>>

defaultOptions is the default options that the ChunkLoadingWebpackPlugin uses.

Methods

Method

Modifiers

Description

apply(compiler)

The entry point of a webpack plugin.