Skip to content

Commit 9a923ec

Browse files
docs
1 parent b9a9d27 commit 9a923ec

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/CREATING_A_PLUGIN.md

+31
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,34 @@ export default {
4949
],
5050
}
5151
```
52+
53+
## Examples
54+
55+
#### Adding Rollup plugin
56+
57+
```javascript
58+
import alias from '@rollup/plugin-alias'
59+
60+
export default {
61+
hooks: [
62+
{
63+
event: 'config',
64+
action: (app, params, ctx) => {
65+
const rollup = {
66+
plugins$map: { alias },
67+
plugins$options: {
68+
alias: {
69+
entries: [
70+
{ find: 'utils', replacement: '../../../utils' },
71+
{ find: 'batman-1.0.0', replacement: './joker-1.5.0' },
72+
],
73+
},
74+
},
75+
}
76+
77+
app.merge({ config: { rollup } })
78+
},
79+
},
80+
],
81+
}
82+
```

0 commit comments

Comments
 (0)