node -v): v7.6.0npm -v): 4.1.2After 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.
Try a mix.copyDirectory inside mix.then
mix.setPublicPath('./');
mix.react('src/index.js', 'public/react')
.then(() => {
mix.copyDirectory('public/react', '../MVC/wwwroot/react');
});
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.
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?