Skip to main content

Vite 是 Strapi 5 中的默认打包器

¥Vite is the default bundler in Strapi 5

在 Strapi 5 中,Vite 是默认的打包器。

¥In Strapi 5, Vite is the default bundler.

此页面是 重大变更数据库 的一部分,提供有关重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的其他说明。

¥This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

 Is this breaking change affecting plugins?Yes
 Is this breaking change automatically handled by a codemod?No

重大更改描述

¥Breaking change description

在 Strapi v4 中

¥In Strapi v4

Webpack 是默认的打包器。

¥Webpack is the default bundler.

在 Strapi 5 中

¥In Strapi 5

Vite  是默认的打包器。

¥Vite  is the default bundler.

迁移

¥Migration

本节重新组合了有关引入的重大更改的有用说明和程序。

¥This section regroups useful notes and procedures about the introduced breaking change.

手动程序

¥Manual procedure

具有自定义 webpack 配置的用户需要转换为 Vite  配置,或者在启动开发服务器时设置 --bundler=webpack 以保持 Strapi v4 行为;在后一种情况下,终端将发出警告。有关更多详细信息,请参阅 bundlers 文档。

¥Users with custom webpack configurations need to convert to Vite  configurations, or alternatively set --bundler=webpack when starting the development server to keep the Strapi v4 behaviour; in the latter case, the terminal will issue a warning. Please refer to the bundlers documentation for additional details.