A
A
Anton Shelestov2018-12-25 15:59:03
Laravel
Anton Shelestov, 2018-12-25 15:59:03

How to set build order of js files via mix?

Hello!
There is a file in laravel webpack.mix.js with the content:

let widgets = require('laravel-mix');
widgets.setPublicPath('../public_html/widget/');

widgets.js([
    'resources/assets/js/widgets/script_prod.js',
    'resources/assets/js/widgets/script.js',
], 'script.js');

widgets.js([
    'resources/assets/js/widgets/script_dev.js',
    'resources/assets/js/widgets/script.js',
], 'script_dev.js');

The output is 2 files, respectively. BUT for some reason the order of connecting the files is not correct.
Because the files must be assembled in order, but for some reason they are assembled in the reverse order, first script.js and then script_prod.js is added (similarly with dev).
Is there a setting that regulates the order in which files are included?
Z.Y. If you delete the code that collects the 2nd file (script_dev.js), then by the way, everything is going to be normal ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wentixon, 2018-12-25
@ShelestovAnt

Instead of js, use the scripts function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question