Copy-webpack-plugin: Fails copying by pattern containing '@' symbol

Created on 15 May 2020  路  5Comments  路  Source: webpack-contrib/copy-webpack-plugin

  • Operating System: Windows 10
  • Node Version: 12.13.0
  • NPM Version: 6.12.1
  • webpack Version: 4.43.0
  • copy-webpack-plugin Version: 6.0.0

Actual Behavior

I get following error in console:
ERROR in unable to locate '**' at 'D:\Source\Elements\Source\Elements\node_modules\@felgaete\base64image**'

Code

{
    from: "**/*",
    to: "ckeditor/plugins/base64image",
    context: "node_modules/@felgaete/base64image/",
}

How Do We Reproduce?

All patterns succeed except the one above

Most helpful comment

:star: ETA today

All 5 comments

Same issue with '@'

I'm using:

  • Operating System: CentOS 8
  • Webpack Version: 4.43.0
  • Copy-webpack-plugin Version: 6.0.0
  • Fontawesome: 5.13.0

Get this error when run webpacker:compile:

unable to locate 'node_modules/@fortawesome/fontawesome-free' at '/vagrant/node_modules/@fortawesome/fontawesome-free/*/'

My code was:
patterns: [{ from: 'node_modules/@fortawesome/fontawesome-free', to: 'raw-fontawesome-free' }]

The above code worked. Now, to work, I had to change to:
patterns: [{ from: 'node_modules/@fortawesome/fontawesome-free/**/*', to: 'raw-fontawesome-free' }]

@evilebottnawi @kevlened @pedrofurtado @marciojg

Thanks for the feedback. Today we will fix this problem.

Something I have noticed

This pattern { from: 'D:\\Projects\\@koot\\_next\\test\\projects\\standard\\public' } will be transformed into Glob D:/Projects/\\@koot/_next/test/projects/standard/public/**/* which cause the problem.

And when I directly provide a pattern with a glob { from: 'D:/Projects/@koot/_next/test/projects/standard/public/**/*' }, everything is fine.

The only difference between the 2 globs is the 2 slashes before @.

I'm using:

  • OS: Windows 10 1909
  • Webpack 4.43

@evilebottnawi @cap-Bernardito looking forward to a release with this fix asap 馃帀 thanks guys for your fast feedback! 馃

:star: ETA today

Was this page helpful?
0 / 5 - 0 ratings