Skip to content

Commit

Permalink
docs: add use as ci checker part
Browse files Browse the repository at this point in the history
  • Loading branch information
tjx666 committed Mar 30, 2024
1 parent da618a8 commit 9633b22
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ const config = {
<br>
</details>

## Use as build checker

```ts
export default defineConfig({
plugins: [
UnpluginDetectDuplicatedDeps({
// will exit build process if duplicated deps found
throwErrorWhenDuplicated: true,
// ignore specific duplicated deps
ignore: {
axios: ['0.27.2'],
vue: ['*'],
},
}),
],
});
```

## Use in commonjs environment

Because [vite6 plan to deprecate commonjs node api](https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated), this plugin deprecate the commonjs support from 1.x. If you want use this plugin in commonjs environment, check [0.x](https://github.com/tjx666/unplugin-detect-duplicated-deps/tree/0.x)
Expand All @@ -73,6 +91,12 @@ Because [vite6 plan to deprecate commonjs node api](https://vitejs.dev/guide/tro
- [bundlephobia](https://bundlephobia.com/) provide the api to get package size
- [vercel](https://vercel.com/) host documentation

## Recommend Readings

- [Rsdoctor | Duplicate Dependency Problem](https://rsdoctor.dev/blog/topic/duplicate-pkg-problem)
- [Pnpm | How peers are resolved](https://pnpm.io/how-peers-are-resolved)
- [如何解决项目依赖重复打包问题](https://yutengjing.com/posts/%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96%E9%87%8D%E5%A4%8D%E6%89%93%E5%8C%85%E9%97%AE%E9%A2%98/)

## License

[MIT](./LICENSE) License © 2023-PRESENT [YuTengjing](https://github.com/tjx666)
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
{ text: 'Introduction', link: '/introduction.md' },
{ text: 'Getting Started', link: '/getting-started.md' },
{ text: 'Configuration', link: '/configuration.md' },
{ text: 'Recommend Readings', link: '/recommend-readings.md' },
],
},
],
Expand Down
18 changes: 18 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,21 @@ export default config;
::: warning
Because [vite6 plan to deprecate commonjs node api](https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated), this plugin deprecate the commonjs support from 1.x. If you want use this plugin in commonjs environment, check [0.x](https://github.com/tjx666/unplugin-detect-duplicated-deps/tree/0.x)
:::

## Use as build checker

```ts
export default defineConfig({
plugins: [
UnpluginDetectDuplicatedDeps({
// will exit build process if duplicated deps found
throwErrorWhenDuplicated: true,
// ignore specific duplicated deps
ignore: {
axios: ['0.27.2'],
vue: ['*'],
},
}),
],
});
```
Binary file modified docs/images/effect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/recommend-readings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Recommend Readings

- [Rsdoctor | Duplicate Dependency Problem](https://rsdoctor.dev/blog/topic/duplicate-pkg-problem)
- [Pnpm | How peers are resolved](https://pnpm.io/how-peers-are-resolved)
- [如何解决项目依赖重复打包问题](https://yutengjing.com/posts/%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96%E9%87%8D%E5%A4%8D%E6%89%93%E5%8C%85%E9%97%AE%E9%A2%98/)

0 comments on commit 9633b22

Please sign in to comment.