Skip to content

Commit d41c2d1

Browse files
committed
docs: update design.md
1 parent 4622319 commit d41c2d1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Design.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,40 @@ nutConfig: {
4040
"preset": [ "preset-pages" ]
4141
}
4242
```
43+
44+
# Plugin API
45+
46+
app.js
47+
48+
```js
49+
export default ( ctx, options ) => {
50+
ctx.api
51+
ctx.events
52+
ctx.expose
53+
ctx.emit
54+
ctx.on
55+
}
56+
```
57+
58+
index.js
59+
60+
```js
61+
module.exports = function ( ctx, options ) {
62+
ctx.restart( reason ) only in dev mode
63+
ctx.refreshBrowser
64+
ctx.html.addScript before(duration) webpack compile
65+
ctx.html.addMeta
66+
ctx.html.addLink
67+
ctx.html.addStyle
68+
ctx.writeVirtualModules
69+
ctx.chainWebpack
70+
ctx.modifyWebpack
71+
ctx.middlewares.append
72+
ctx.middlewares.prepend
73+
ctx.middlewares.before
74+
ctx.middlewares.after
75+
ctx.emit
76+
ctx.on
77+
ctx.expose
78+
}
79+
```

0 commit comments

Comments
 (0)