中文

Plugins

Using Plugins

In a standard Umi application, by default, no plugins are included. If you want to use Max's features (such as data flow, antd, etc.), you will need to manually install the plugins and enable them:

pnpm add -D @umijs/plugins

To enable the antd plugin:

// .umirc.ts
export default {
plugins: ['@umijs/plugins/dist/antd'],
antd: {}
}

The difference between Umi and Max is that Max already has most plugins built-in, such as data flow (initial-state, model), antd, etc. These plugins can be loaded and enabled from @umijs/plugins/dist/*.

For further information about the features and configuration instructions offered by Max, please refer to the Umi Max section.

💡

Should I choose Max?
Using Max does not mean you have to use all of its features; you can disable plugins according to your needs. So, when you need Max's features, you can always choose to create a Max project.

Project-level Plugins

If you want to quickly use the functionality of plugins in your project (such as modifying the output html), you can create a plugin.ts in the project's root directory to write a project-level plugin, which will be automatically loaded as a plugin.

For a more detailed explanation of the directory structure, please refer to the Directory Structure section.

Developing Plugins

Please refer to the Developing Plugins section.

Last updated:

TABLE OF CONTENTS