You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: readme.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Delete files and folders using Rollup.
4
4
5
5
## About
6
6
7
-
This plugin is useful when you want to clean `dist` or other folders and files before bundling. It's using [del package](https://github.com/sindresorhus/del) inside, check it for pattern examples.
7
+
This plugin is useful when you want to clean `dist` or other folders and files before bundling. It's using [del package](https://github.com/sindresorhus/del) inside, check it for [pattern examples](https://github.com/sindresorhus/del?tab=readme-ov-file#patterns) and [additional options](https://github.com/sindresorhus/del?tab=readme-ov-file#options).
8
8
9
9
## Installation
10
10
@@ -31,7 +31,7 @@ export default {
31
31
file:'dist/app.js'
32
32
},
33
33
plugins: [
34
-
del({ targets:'dist/*' })
34
+
del({ targets:'dist' })
35
35
]
36
36
}
37
37
```
@@ -45,14 +45,17 @@ There are some useful options:
45
45
A string or an array of patterns of files and folders to be deleted. Default is `[]`.
46
46
47
47
```js
48
+
// Folder
48
49
del({
49
50
targets:'build'
50
51
})
51
52
53
+
// Files
52
54
del({
53
55
targets:'dist/*.js'
54
56
})
55
57
58
+
// Multiple targets
56
59
del({
57
60
targets: ['dist/*', 'images/*.webp']
58
61
})
@@ -62,15 +65,16 @@ del({
62
65
63
66
Output removed files and folders to console. Default is `false`.
64
67
68
+
> [!NOTE]
69
+
> Use \* (wildcard character) in pattern to show removed files
70
+
65
71
```js
66
72
del({
67
73
targets:'dist/*',
68
74
verbose:true
69
75
})
70
76
```
71
77
72
-
> Note: use \* (wildcard character) in pattern to show removed files
73
-
74
78
#### hook
75
79
76
80
[Rollup hook](https://rollupjs.org/plugin-development/#build-hooks) the plugin should use. Default is `buildStart`.
0 commit comments