Search code examples
laravellaravel-mix

Laravel Mix Error Using version() and copyDirectory()


I am having a problem using copyDirectory() with version() on laravel mix.

let mix = require('laravel-mix'),

mix.copyDirectory('node_modules/bootstrap', 'public/vendor/bootstrap')
.sass('resources/assets/sass/style.scss', 'public/css')
.version();

Is there any other way to do this?


Solution

  • The code below worked as expected now.

    let mix = require('laravel-mix'),
    
    mix.copyDirectory('node_modules/bootstrap', 'public/vendor/bootstrap')
    .sass('resources/assets/sass/style.scss', 'public/css')
    .version();
    

    It turned out that the one of the copyDirectory entry is causing the problem, which is:

    .copyDirectory('node_modules/chart.js', 'public/vendor/chart.js')
    

    So, I just converted it to .copy() and I just copied the js and css file for the chart.js.

    Everything worked as expected after that.