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