A

webpack/v5/set-target-to-false-and-update-plugins

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

This codemod migrates the target property in Webpack configurations from a function to false and moves the function to the plugins array.

In Webpack 4, it was possible to set the target property to a function. However, in Webpack 5, this approach is no longer supported. Instead, the target should be set to false, and the function should be included in the plugins array. This codemod automates the transformation of Webpack configurations to adhere to the new specification.

Example

Before

ts

After

ts

,

Before

ts

After

ts

,

Before

ts

After

ts

,

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.