SPØLJØ's avatar

Laravel Mix is compiling files to a wrong directory

Hey, I am using Laravel Mix for the first time in a stand-alone project and I am facing a problem I can't solve. "app.js" is for some reason being compiled to /themes/default/assets/compiled/themes/default/assets/compiled/js/app.js instead of /themes/default/assets/compiled/js/app.js.

Screenshot

0 likes
3 replies
alenabdula's avatar

Try following:

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

mix.setPublicPath('themes/default/assets/compiled');

mix.js('themes/default/assets/js/app.js', 'js');
1 like
topvillas's avatar

Try an absolute path.

mix.setPublicPath('/themes/default/assets/compiled');

Please or to participate in this conversation.