Skip to content

Commit

Permalink
docs: make docs happy
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Jul 12, 2023
1 parent fc1b031 commit 7ca96c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,15 @@ export default defineConfig({

### Options

```ts
export type PresetDomain = 'auto' | 'jsdelivr' | 'unpkg' | false

export interface CDNPluginOptions {
modules?: Array<TrackModule | string>
/**
*auto will read the package.json has unpkg or jsdelivr path. If not willn't be
* repalce. set false you can define spare for each module.
*/
url?: string
include?: FilterPattern
exclude?: FilterPattern
/**
* Transform can replace the capture result. and rewrite them.
*/
transform?: () => InjectVisitor
logLevel?: "slient" | "warn"
}
```
| params | type | default | description |
| ---------------------- | --------------------------------------------- | ----------------- | -------------------------------------------------------------- |
| `include` | `string \| RegExp \| Array<string \| RegExp>` | `/\.(mjs|js|ts|vue|jsx|tsx)(\?.*|)$/` | Include all assets matching any of these conditions. |
| `exclude` | `string \| RegExp \| Array<string \| RegExp>` | `-` | Exclude all assets matching any of these conditions. |
| `url` | `string` | `jsdelivr` | cdn source url |
| `modules` | `Array<string>\| Array<TrackModule>` | `[]` | modules to be processed |
| `transform` | `()=>InjectVisitor` | `-` | Transform can replace the capture result. and rewrite them. |
| `logLevel` | `'slient'|'warn'` | `warn` | Adjust console output verbosity |


### Acknowledgements

Expand Down
8 changes: 6 additions & 2 deletions docs/Background.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ async function dynamicImport () {
return react
}


```

In most of case, we won't use dynamic import to introduce some libraries.
In most of case, we won't use dynamic import to introduce some libraries.

### Use export all as little as possible

Although we support `export * from 'module'`. But in most of case we don't encourage
users to use it. Because it's a long transform task. And we only handle the duplicate node(Just remove duplicate node)

0 comments on commit 7ca96c3

Please sign in to comment.