2 years ago

Laravel mix put all js code inside app.js

Posted 2 years ago by kiwo123

I wonder if its possible to put everything inside the app.js file? I have a lot of files that I wont touch for a long time so I dont need to worrie about cache.

Right now I am doing this in my webpack.mix.js: mix.js('resources/assets/js/app.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .scripts([ 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js' ], 'public/js/all.js');

This will make two JS files: app.js and all.js. What I now want to do is to combine those files into one big file app.js. Is this possible with?:

mix.babel(['app.js', 'all.js'], 'app.js'); ?

Please sign in or create an account to participate in this conversation.