Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add addEntryImports example code #5077

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/plugins/api.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ api.skipPlugins(['@umijs/plugin-dva']);

在入口文件最后添加代码。

```ts
api.addEntryCode(() => {
return `console.log('works!')`
})
```

### addEntryCodeAhead

在入口文件最前面(import 之后)添加代码。
Expand All @@ -178,6 +184,17 @@ api.skipPlugins(['@umijs/plugin-dva']);

在入口文件现有 import 的后面添加 import。

```ts
api.addEntryImport(() => {
return [
{
source: '/modulePath/xxx.js',
specifier: 'moduleName',
}
]
});
```

### addEntryImportsAhead

在入口文件现有 import 的前面添加 import。
Expand Down