laravel-mix: mix.copy does not allow for the glob params.
laravel.mix.js
mix.copy('src/images/*{.png,.jpg}', 'dist/images');
Let’s say I have 2 files:
/src/images/example.png
/src/images/example.jpg
when I run the npm run webpack it copies whole images dir into dist:
/dist/images/src/images/example.png
/dist/images/src/images/example.jpg
and should be:
/dist/images/example.png
/dist/images/example.jpg
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 16 (2 by maintainers)
Commits related to this issue
- Merge pull request #135 from zgabievi/master copy command should have flatten paths. fix for issue #101 — committed to laravel-mix/laravel-mix by JeffreyWay 7 years ago
I’m not sure about this fix - it means you can’t copy a tree without it being flattened.
My solution is to use the ‘context’ copy-webpack-plugin option. Context allows you to specify the root that the copy is relative to - rather than implying it all from the ‘from’ arg.
Something like:
This is fixed now in #135.