-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplugin.ts
More file actions
37 lines (35 loc) · 1.1 KB
/
plugin.ts
File metadata and controls
37 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* eslint-disable @typescript-eslint/no-unused-expressions */
/**
* develop your own plugins
*/
import { IApi } from 'umi'
export default (api: IApi) => {
// api.logger.profile('mark')
api.modifyHTML(($) => {
return $
})
// api.addHTMLMetas(() => [{ name: 'foo', content: 'bar' }])
// api.addHTMLLinks(() => [{ rel: '', content: 'bar' }])
// api.addHTMLStyles(() => [`body { color: red; }`])
// api.addHTMLHeadScripts(() => [`console.log('hello world from head')`])
// api.addHTMLScripts(() => [`console.log('hello world')`])
// api.addEntryCodeAhead(() => [`console.log('entry code ahead')`])
// api.addEntryCode(() => [`console.log('entry code')`])
api.onDevCompileDone((opts) => {
opts
// console.log('> onDevCompileDone', opts.isFirstCompile);
})
api.onBuildComplete((opts) => {
// api.logger.profile('mark', 'end msg')
opts
// console.log('> onBuildComplete', opts.isFirstCompile);
})
api.chainWebpack((memo) => {
memo
})
api.onStart(() => {})
api.onCheckCode((args) => {
args
// console.log('> onCheckCode', args);
})
}