Skip to content

Commit

Permalink
add addEntryImports example code (#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
djyde committed Jul 23, 2020
1 parent 42acd79 commit b12baf7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/plugins/api.zh-CN.md
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

0 comments on commit b12baf7

Please sign in to comment.