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
|[`context`](#context)|`{String}`|`options.context \|\| compiler.options.context`| A path that determines how to interpret the `from` path. |
82
-
|[`globOptions`](#globoptions)|`{Object}`|`undefined`|[Options][glob-options] passed to the glob pattern matching library including `ignore` option. |
83
-
|[`toType`](#totype)|`{String}`|`undefined`| Determinate what is `to` option - directory, file or template. |
84
-
|[`force`](#force)|`{Boolean}`|`false`| Overwrites files already in `compilation.assets` (usually added by other plugins/loaders). |
85
-
|[`flatten`](#flatten)|`{Boolean}`|`false`| Removes all directory references and only copies file names. |
86
-
|[`transform`](#transform)|`{Function}`|`undefined`| Allows to modify the file contents. |
87
-
|[`cacheTransform`](#cacheTransform)|`{Boolean\|Object}`|`false`| Enable `transform` caching. You can use `{ cache: { key: 'my-cache-key' } }` to invalidate the cache. |
88
-
|[`transformPath`](#transformpath)|`{Function}`|`undefined`| Allows to modify the writing path. |
89
-
|[`noErrorOnMissing`](#noerroronmissing)|`{Boolean}`|`false`| Doesn't generate an error on missing file(s). |
|[`context`](#context)|`{String}`|`options.context \|\| compiler.options.context`| A path that determines how to interpret the `from` path. |
82
+
|[`globOptions`](#globoptions)|`{Object}`|`undefined`|[Options][glob-options] passed to the glob pattern matching library including `ignore` option. |
83
+
|[`toType`](#totype)|`{String}`|`undefined`| Determinate what is `to` option - directory, file or template. |
84
+
|[`force`](#force)|`{Boolean}`|`false`| Overwrites files already in `compilation.assets` (usually added by other plugins/loaders). |
85
+
|[`flatten`](#flatten)|`{Boolean}`|`false`| Removes all directory references and only copies file names. |
86
+
|[`transform`](#transform)|`{Function}`|`undefined`| Allows to modify the file contents. |
87
+
|[`cacheTransform`](#cacheTransform)|`{Boolean\|String\|Object}`|`false`| Enable `transform` caching. You can use `{ cache: { key: 'my-cache-key' } }` to invalidate the cache. |
88
+
|[`transformPath`](#transformpath)|`{Function}`|`undefined`| Allows to modify the writing path. |
89
+
|[`noErrorOnMissing`](#noerroronmissing)|`{Boolean}`|`false`| Doesn't generate an error on missing file(s). |
90
90
91
91
#### `from`
92
92
@@ -456,12 +456,16 @@ module.exports = {
456
456
457
457
#### `cacheTransform`
458
458
459
-
Type: `Boolean|Object`
459
+
Type: `Boolean|String|Object`
460
460
Default: `false`
461
461
462
-
Enable/disable `transform` caching. You can use `{ cacheTransform: { key: 'my-cache-key' } }` to invalidate the cache.
462
+
Enable/disable and configure caching.
463
463
Default path to cache directory: `node_modules/.cache/copy-webpack-plugin`.
464
464
465
+
##### `Boolean`
466
+
467
+
Enables/Disable `transform` caching.
468
+
465
469
**webpack.config.js**
466
470
467
471
```js
@@ -483,6 +487,132 @@ module.exports = {
483
487
};
484
488
```
485
489
490
+
##### `String`
491
+
492
+
Enables `transform` caching and setup cache directory.
Copy file name to clipboardExpand all lines: test/__snapshots__/validate-options.test.js.snap
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,12 @@ exports[`validate options should throw an error on the "patterns" option with "[
37
37
- options.patterns[0].from should be an non-empty string."
38
38
`;
39
39
40
+
exports[`validate options should throw an error on the "patterns" option with "[{"from":"test.txt","to":"dir","context":"context","cacheTransform":{"foo":"bar"}}]" value 1`] =`
41
+
"Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
42
+
- options.patterns[0].cacheTransform has an unknown property 'foo'. These properties are valid:
43
+
object {directory?, keys? }"
44
+
`;
45
+
40
46
exports[`validate options should throw an error on the "patterns" option with "[{"from":"test.txt","to":"dir","context":"context","flatten":"true"}]" value 1`] =`
41
47
"Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
42
48
- options.patterns[0].flatten should be a boolean."
@@ -69,11 +75,12 @@ exports[`validate options should throw an error on the "patterns" option with "[
0 commit comments