Framework: [5.4] mix.copy() directory -- files are copied without directories

Created on 26 Jan 2017  路  1Comment  路  Source: laravel/framework

  • Laravel Version: 5.4
  • PHP Version: 7

Description:

When executing mix.copy() on a directory, only files are copied.

Reading the documentation one would expect that the whole directory structure is copied, but I only get the files without directories.

All the files, including those in sub-directories, are copied into the target directory.

Steps To Reproduce:

// webpack.mix.js
mix.copy(<source directory>, <target directory>);

// console
npm run dev

Most helpful comment

This should be filed in the Laravel Mix repo.

But the answer is because Mix flattens the directory structure when copying. You can disabled this by passing false as the third argument (flatten = false) to the mix.copy() method.

>All comments

This should be filed in the Laravel Mix repo.

But the answer is because Mix flattens the directory structure when copying. You can disabled this by passing false as the third argument (flatten = false) to the mix.copy() method.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YannPl picture YannPl  路  3Comments

JamborJan picture JamborJan  路  3Comments

kerbylav picture kerbylav  路  3Comments

shopblocks picture shopblocks  路  3Comments

Anahkiasen picture Anahkiasen  路  3Comments