v4 code migration: Updating the webpack configuration
This guide is part of the v4 code migration guide designed to help you migrate the code of a Strapi application from v3.6.x to v4.0.x
🤓 v3/v4 comparison
In both Strapi v3 and v4, the webpack configuration is customizable.
In Strapi v4, webpack v5 is used, and only ./src/admin/app.js
and the files under the ./src/admin/extensions
folder are being watched by the webpack dev server (see admin panel customization documentation).
☑️ Prerequisites
Make sure webpack plugins and loaders are upgraded to the latest version before migrating.
To update the webpack configuration to Strapi v4:
- Rename the
./src/admin/webpack.config.example.js
to./src/admin/webpack.config.js
. - Copy the content of
./admin/admin.config.js
from the Strapi v3 application to./src/admin/webpack.config.js
.