Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ This page is part of the [Strapi v4 to v5 migration](/dev-docs/migration/v4-to-v

- [Vite is the default bundler in Strapi 5](/dev-docs/migration/v4-to-v5/breaking-changes/vite)
- [Strapi 5 uses react-router-dom v6](/dev-docs/migration/v4-to-v5/breaking-changes/react-router-dom-6)
- [Webpack Aliases are removed in Strapi 5](/dev-docs/migration/v4-to-v5/breaking-changes/webpack-aliases-removed)

## Internal changes

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Webpack Aliases are removed
description: A simplified approach of aliasing in Strapi v5.
sidebar_label: Webpack Aliases removed
displayed_sidebar: devDocsMigrationV5Sidebar
tags:
- breaking changes
- dependencies
- webpack
---

import Intro from '/docs/snippets/breaking-change-page-intro.md'
import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.md'

# Webpack Aliases are removed

In Strapi v5, webpack aliases are removed ensuring better compatibility and reduced dependency conflicts.

<Intro />

## Breaking change description

<SideBySideContainer>

<SideBySideColumn>

**In Strapi v4**

- We maintained a specific list of dependencies that were aliased in webpack configuration. This ensured that plugins consistently used our versions of certain libraries like the design-system.

</SideBySideColumn>

<SideBySideColumn>

**In Strapi 5**

- In Strapi v5, we have simplified the aliasing process. Now, we only alias essential dependencies like `react`, `react-dom`, `react-router-dom`, and `styled-components`.

</SideBySideColumn>

</SideBySideContainer>

## Migration

<MigrationIntro />

### Notes

- If you encounter issues with third-party plugins, we recommend opening an issue on the respective plugin's repository. Encourage the plugin maintainers to add their dependencies to their `package.json` file to resolve compatibility issues.

- If you encounter issues with local plugins, you can fix them by amending the `resolve` option in your chosen bundler.


### Manual procedure

To migrate to Strapi 5:

- Identify any configuration files (e.g., webpack configuration) that referenced the now-removed Webpack aliases in Strapi v4.
- Ensure that any references to Webpack aliases in the code are replaced with appropriate imports or paths.
- If third-party plugins are used in the project, verify that they do not rely on Webpack aliases that are no longer present in Strapi v5.
- If necessary, communicate with the plugin authors to update their dependencies or configurations accordingly.
17 changes: 16 additions & 1 deletion docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,14 @@ const sidebars = {
label: 'Introduction',
id: 'dev-docs/migration/v4-to-v5/introduction'
},
'dev-docs/migration/v4-to-v5/breaking-changes',
{
type: 'doc',
label: 'Breaking Changes',
id: 'dev-docs/migration/v4-to-v5/breaking-changes',
customProps: {
updated: true,
},
},
'dev-docs/migration/v4-to-v5/migration-guides',
]
}
Expand Down Expand Up @@ -1132,6 +1139,14 @@ const sidebars = {
items: [
'dev-docs/migration/v4-to-v5/breaking-changes/vite',
'dev-docs/migration/v4-to-v5/breaking-changes/react-router-dom-6',
{
type: 'doc',
label: 'Webpack Aliases Removed',
id: 'dev-docs/migration/v4-to-v5/breaking-changes/webpack-aliases-removed',
customProps: {
new: true,
},
},
]
},
{
Expand Down