close

NodeTemplatePlugin

This plugin is used to bundle Node.js assets, often used with childCompiler.

It applies the 'commonjs' chunk format and configures output.chunkLoading for Node.js runtimes.

By default it sets output.chunkLoading to 'require'. When asyncChunkLoading is enabled, it uses 'async-node' instead.

new rspack.node.NodeTemplatePlugin();

Options

asyncChunkLoading

  • Type: boolean
  • Default: false

Use 'async-node' chunk loading for async chunks instead of 'require'.