- Basic Usage
There might be times when, as part of your build, you need to copy one or more files from one location to another. Mix's
copy() command makes this a cinch.
Copy a Single File
Copy Multiple Files
mix.copy([ 'src/foo/one.css', 'src/bar/two.css' ], 'public/css');
Copy a Directory
A common usecase for this is when you wish to move a set of fonts, installed through NPM, to your public directory.
If it provides more clarity,
mix.copyDirectory() is an alias for
mix.copy(). The following is identical to the previous example.
Please note that, when providing a directory path as the first argument, the output will retain the original directory structure. If you wish to "flatten" it, provide a wildcard search.
Copy Files With the Given Extension
Exclude an Extension From Being Copied
The above will copy all files except for those that end in