Skip to content

Commit 5415087

Browse files
authored
Merge pull request #137 from chrisblossom/options-partial
replace Partial<Options> with explicit optional options
2 parents 4f8ae44 + 18f71a5 commit 5415087

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/clean-webpack-plugin.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ export interface Options {
88
*
99
* default: false
1010
*/
11-
dry: boolean;
11+
dry?: boolean;
1212

1313
/**
1414
* Write Logs to Console
1515
* (Always enabled when dry is true)
1616
*
1717
* default: false
1818
*/
19-
verbose: boolean;
19+
verbose?: boolean;
2020

2121
/**
2222
* Automatically remove all unused webpack assets on rebuild
2323
*
2424
* default: true
2525
*/
26-
cleanStaleWebpackAssets: boolean;
26+
cleanStaleWebpackAssets?: boolean;
2727

2828
/**
2929
* Do not allow removal of current webpack assets
3030
*
3131
* default: true
3232
*/
33-
protectWebpackAssets: boolean;
33+
protectWebpackAssets?: boolean;
3434

3535
/**
3636
* Removes files once prior to Webpack compilation
@@ -40,7 +40,7 @@ export interface Options {
4040
*
4141
* default: ['**\/*']
4242
*/
43-
cleanOnceBeforeBuildPatterns: string[];
43+
cleanOnceBeforeBuildPatterns?: string[];
4444

4545
/**
4646
* Removes files after every build (including watch mode) that match this pattern.
@@ -50,7 +50,7 @@ export interface Options {
5050
*
5151
* default: disabled
5252
*/
53-
cleanAfterEveryBuildPatterns: string[];
53+
cleanAfterEveryBuildPatterns?: string[];
5454

5555
/**
5656
* Allow clean patterns outside of process.cwd()
@@ -59,7 +59,7 @@ export interface Options {
5959
*
6060
* default: false
6161
*/
62-
dangerouslyAllowCleanPatternsOutsideProject: boolean;
62+
dangerouslyAllowCleanPatternsOutsideProject?: boolean;
6363
}
6464

6565
class CleanWebpackPlugin {
@@ -74,7 +74,7 @@ class CleanWebpackPlugin {
7474
private initialClean: boolean;
7575
private outputPath: string;
7676

77-
constructor(options: Partial<Options> = {}) {
77+
constructor(options: Options = {}) {
7878
if (typeof options !== 'object' || Array.isArray(options) === true) {
7979
throw new Error(`clean-webpack-plugin only accepts an options object. See:
8080
https://github.com/johnagan/clean-webpack-plugin#options-and-defaults-optional`);

0 commit comments

Comments
 (0)