I encounter this too, I want to copy resources from node_modules to my resources folder and then include them in sass but the copy runs after the .sass() command. Did you find a solution for this?
Mar 16, 2017
2
Level 1
Laravel Mix copy happening after compile of files (Laravel 5.4)
It seems like files that I am copying are being copied after the files are being transpiled.
mix.js('resources/assets/js/app.js', 'public/js/footer.js')
.sass('resources/assets/sass/app.scss', 'public/css/')
mix.copy('vendor/zurb/foundation/js', 'resources/assets/js/foundation', false) .copy('vendor/zurb/foundation', 'resources/assets/sass/foundation', false)
.version();
when I run this the first time I get errors like ./foundation/foundation.util.mediaQuery.js in ./resources/assets/js/foundation.js but when it run it again it works correctly no errors.
This leads me to believe that the .copy is happening after the compile (I assume this file is running asynchronously) and so the file are not found.
Is there a way to do the copy before all the other files are compiled or turn off async?
Please or to participate in this conversation.