webpack-contrib/copy-webpack-plugin

Cache directory can't be configured

jramstedt opened this issue · 7 comments

Bug report

Documentation says "Enables transform caching and setup cache directory and invalidation keys." and gives example of setting cache directory.

Actual Behavior

[webpack-cli] ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.

  • options.patterns[0].transform.cache has an unknown property 'directory'. These properties are valid:
    object { keys? }

Expected Behavior

No errors and cache is used from configured directory.

How Do We Reproduce?

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:
OS: Windows 10 10.0.19045
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 21.26 GB / 31.96 GB
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 112.0.5615.138
Edge: Spartan (44.19041.1266.0), Chromium (112.0.1722.58)
Internet Explorer: 11.0.19041.1566
Packages:
arraybuffer-loader: ^1.0.8 => 1.0.8
babel-loader: ^9.0.0 => 9.1.2
clean-webpack-plugin: ^4.0.0-alpha.0 => 4.0.0
copy-webpack-plugin: ^11.0.0 => 11.0.0
css-loader: ^6.2.0 => 6.7.3
css-minimizer-webpack-plugin: ^5.0.0 => 5.0.0
eager-imports-webpack-plugin: ^1.0.0 => 1.0.0
html-webpack-plugin: ^5.3.1 => 5.5.1
image-minimizer-webpack-plugin: ^3.0.0 => 3.8.2
post-compile-webpack-plugin: ^0.1.2 => 0.1.2
style-loader: ^3.2.1 => 3.3.2
terser-webpack-plugin: ^5.0.3 => 5.3.7
ts-loader: ^9.1.1 => 9.4.2
webfontloader: ^1.6.28 => 1.6.28
webpack: ^5.36.0 => 5.81.0
webpack-bundle-analyzer: ^4.2.0 => 4.8.0
webpack-cli: ^5.0.0 => 5.0.2
webpack-dev-server: ^4.0.0 => 4.13.3
webpack-merge: ^5.4.0 => 5.8.0

Ok. The documentation is wrong then.

@jramstedt Can you show me? Or maybe you can send a PR with fix?

@alexander-akait If you search "Enables transform caching and setup cache directory and invalidation keys." on the README.md you will find multiple examples with wrong examples.

Such as:
cache: { directory: path.resolve(__dirname, "cache-directory"), keys: {

Thank you very match, my bad, fixed #741