Thursday, March 9, 2017

Laravel Mix - Compilation of files to the right folders

I'm new with laravel mix and I have one question. I have this code:

mix.js([
    'resources/assets/js/navigation/grid/grid.js',
], 'public/js/navigation/grid/grid.js');

mix.js([
    'resources/assets/js/custom-jquery.js',
], 'public/js/app.js');

mix.js([
    'resources/assets/js/machine/detail.js',
], 'public/js/machine/machine-detail.js');

where are three different files which I want to compile into separated files. Compilation is without problem but I have a trouble with destination of compilation because in the end I will get these files in path public/js/navigation/grid but each file should have own path. When I try change order, for example:

mix.js([
    'resources/assets/js/machine/detail.js',
], 'public/js/machine/machine-detail.js');

mix.js([
    'resources/assets/js/navigation/grid/grid.js',
], 'public/js/navigation/grid/grid.js');

mix.js([
    'resources/assets/js/custom-jquery.js',
], 'public/js/app.js');

then I will get all three files inside public/js/machine. What I have wrong or what can I do to get these files inside right paths?



via Jaroslav Klimčík

Advertisement