Skip to content

Commit fe030db

Browse files
committed
docs: add webpack usage
1 parent c6965d0 commit fe030db

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default defineConfig({
2828
});
2929
```
3030

31-
<br></details>
31+
<br>
32+
</details>
3233

3334
<details>
3435
<summary>Rollup</summary><br>
@@ -42,7 +43,24 @@ export default {
4243
};
4344
```
4445

45-
<br></details>
46+
<br>
47+
</details>
48+
49+
<details>
50+
<summary>Webpack</summary><br>
51+
52+
```ts
53+
// webpack.config.mjs
54+
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/webpack';
55+
56+
const config = {
57+
plugins: [UnpluginDetectDuplicatedDeps()],
58+
};
59+
export default config;
60+
```
61+
62+
<br>
63+
</details>
4664

4765
## Use in commonjs environment
4866

docs/getting-started.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bun add -D unplugin-detect-duplicated-deps
1616

1717
## Add to config file
1818

19-
### Vit
19+
### Vite
2020

2121
```ts
2222
// vite.config.ts
@@ -38,6 +38,18 @@ export default {
3838
};
3939
```
4040

41+
### Webpack
42+
43+
```ts
44+
// webpack.config.mjs
45+
import UnpluginDetectDuplicatedDeps from 'unplugin-detect-duplicated-deps/webpack';
46+
47+
const config = {
48+
plugins: [UnpluginDetectDuplicatedDeps()],
49+
};
50+
export default config;
51+
```
52+
4153
::: warning
4254
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)
4355
:::

0 commit comments

Comments
 (0)