Laravel-mix: copyDirectory not work in mix.then

Created on 28 Aug 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.4.2
  • Node Version (node -v): v7.6.0
  • NPM Version (npm -v): 4.1.2
  • OS: windows7

Description:

After compiling assets I want to copy the results to another directory. So I use the mix.then event hook, but it doesn't work. But it works outside the mix.then block.

Steps To Reproduce:

Try a mix.copyDirectory inside mix.then

code

mix.setPublicPath('./');
mix.react('src/index.js', 'public/react')
  .then(() => {
    mix.copyDirectory('public/react', '../MVC/wwwroot/react');
  });

Most helpful comment

@JeffreyWay what is the proper way to have mix perform more mix actions on files that are being created with mix ?

Is there a way to run two passes of mix that doesn't involve running two commands?

All 3 comments

Mix doesn't work that way, so you can't do this. Mix.then() will be triggered once Mix is entirely finished with its job.

@JeffreyWay what is the proper way to have mix perform more mix actions on files that are being created with mix ?

Is there a way to run two passes of mix that doesn't involve running two commands?

This would be useful to know the answer to, @JeffreyWay.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdebacker picture sdebacker  路  3Comments

pixieaka picture pixieaka  路  3Comments

dtheb picture dtheb  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

Micaso picture Micaso  路  3Comments