Skip to content

Commit 90f7722

Browse files
committed
feat: add override manual to the readme
1 parent d95b335 commit 90f7722

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,22 @@ terser (considered by default in production)
7272
replace (considered by default in production)
7373
```
7474

75-
You can pass an input plugin with their supported option:
75+
### Override Default Options for the plugins `[name, overriddenOptions, true]`
76+
77+
You can pass an input plugin with the overridden options using the `[name, overriddenOptions, true]` syntax.
78+
79+
```ts
80+
const plugins = createPlugins([
81+
["ts", { tsconfig: "./lib/tsconfig.json" }, true], // third element makes the config merge to and override the default options
82+
"js",
83+
])
84+
```
85+
86+
The difference with the next syntax is that these are merged into the default options and if there is a config with the same name, they override it, but the next syntax completely replaces the default options.
87+
88+
### Completely New Options for the plugins `[name, newOptions]`
89+
90+
You can pass an input plugin with their supported option using the `[name, newOptions]` syntax:
7691

7792
```ts
7893
const plugins = createPlugins([
@@ -81,16 +96,21 @@ const plugins = createPlugins([
8196
])
8297
```
8398

84-
For adding extra plugins, you can:
99+
### Adding New Extra Plugins
100+
101+
For adding extra plugins, you can pass them in array to the second argument
85102

86103
```ts
87104
import multyentry from '@rollup/plugin-multi-entry'
88-
createPlugins(["ts", [multyentry()])
105+
createPlugins(["ts"], [multyentry()])
89106
```
90107

91-
### createConfig
92108

93-
You can use `createConfig` to create the configs you need. This is a simple wrapper around the rollup config.
109+
### createConfig (not recommend)
110+
111+
This is a simple wrapper around the rollup config, so it is recommended to use the default Rollup syntax.
112+
113+
You can use `createConfig` to create the configs you need.
94114

95115
```ts
96116
createConfig(

0 commit comments

Comments
 (0)