copy-webpack-plugin
Advanced tools
Comparing version 4.4.3 to 4.5.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="4.5.0"></a> | ||
# [4.5.0](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v4.4.3...v4.5.0) (2018-03-02) | ||
### Features | ||
* **processPattern:** add support for `{RegExp)` matches (`pattern.test`) ([#235](https://github.com/webpack-contrib/copy-webpack-plugin/issues/235)) ([1861730](https://github.com/webpack-contrib/copy-webpack-plugin/commit/1861730)) | ||
<a name="4.4.3"></a> | ||
@@ -7,0 +17,0 @@ ## [4.4.3](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v4.4.2...v4.4.3) (2018-03-01) |
@@ -106,2 +106,3 @@ 'use strict'; | ||
file.webpackTo = pattern.to; | ||
file.webpackToRegExp = pattern.test; | ||
} | ||
@@ -108,0 +109,0 @@ |
@@ -105,2 +105,3 @@ 'use strict'; | ||
content: content, | ||
regExp: file.webpackToRegExp, | ||
context: pattern.context | ||
@@ -107,0 +108,0 @@ }); |
{ | ||
"name": "copy-webpack-plugin", | ||
"version": "4.4.3", | ||
"version": "4.5.0", | ||
"description": "Copy files && directories with webpack", | ||
@@ -5,0 +5,0 @@ "author": "Len Boyette", |
@@ -58,2 +58,3 @@ [![npm][npm]][npm-url] | ||
|[`toType`](#toType)|`{String}`|``|[toType Options](#toType)| | ||
|[`test`](#test)|`{RegExp}`|``|Pattern for extracting elements to be used in `to` templates| | ||
|[`force`](#force)|`{Boolean}`|`false`|Overwrites files already in `compilation.assets` (usually added by other plugins/loaders)| | ||
@@ -147,2 +148,23 @@ |[`ignore`](#ignore)|`{Array}`|`[]`|Globs to ignore for this pattern| | ||
### `test` | ||
Defines a `{RegExp}` to match some parts of the file path. | ||
These capture groups can be reused in the name property using `[N]` placeholder. | ||
Note that `[0]` will be replaced by the entire path of the file, | ||
whereas `[1]` will contain the first capturing parenthesis of your `{RegExp}` | ||
and so on... | ||
**webpack.config.js** | ||
```js | ||
[ | ||
new CopyWebpackPlugin([ | ||
{ | ||
from: '*/*', | ||
to: '[1]-[2].[hash].[ext]', | ||
test: /([^/]+)\/(.+)\.png$/ | ||
} | ||
], options) | ||
] | ||
``` | ||
### `force` | ||
@@ -149,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45073
557
393