oaj's avatar
Level 12

How can I get mix(webpack) to run a segment after another is finished?

In my webpack.mix.js i want to copy an asset from the node_modules directroy to public/css, and then version the copied file

mix.copy([
        'node_modules/font-awesome/css/font-awesome.min.css'
    ], 'public/css');
.version(
    [
        'public/css/font-awesome.min.css'
    ]
);

This approach does not work since both "tasks" run in parallel it seems and the version part fails because font-awesome.min.js is not present in public/css.

How can I ensure the copy has finished before versioning?

0 likes
1 reply
ejdelmonico's avatar

@oaj Try running two separate instances of the mix command. The first one should copy what you need to public and then the second one can do the normal stuff. Give that a try.

Please or to participate in this conversation.