A
A
Alex Wells2017-02-05 20:05:56
Frontend
Alex Wells, 2017-02-05 20:05:56

How to use strict order in Laravel Mix?

Hello. I am writing a website using AdminLTE for the front-end. It's written in less and compiled to css, so you have to do something like this:

mix.sass('node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss', 'public/css/bootstrap.css')
    .sass('node_modules/normalize-scss/sass/_normalize.scss', 'public/css/normalize.css')
    .combine([
        'public/css/bootstrap.css',
        'public/css/normalize.css',
        'node_modules/admin-lte/dist/css/skins/_all-skins.css',
        'node_modules/admin-lte/dist/css/AdminLTE.css',
        'node_modules/ionicons/dist/css/ionicons.css',
        'node_modules/font-awesome/css/font-awesome.css'
    ], 'public/css/vendor.css');

mix.js(['resources/assets/js/app.js', 'resources/assets/js/adminlte.js'], 'public/js/app.js');
    //.extract(['vue']);

mix.sass('resources/assets/sass/app.scss', 'public/css');

But laravel mix swears: AssertionError: Mix.combine() error: "public/css/bootstrap.css does not exist.
So the question is: how to make a hard order of execution? Laravel mix which is new, on webpack, not the old one. 5.4 .

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Max, 2017-03-11
@Alex_Wells

Use laravel-mix version 0.8.8. In it, you can already first compile scss to css, and then combine this file with others.
node config:
node v7.7.2
npm v4.1.2

A
Alexander Aksentiev, 2017-02-05
@Sanasol

split into multiple "tasks"
mix.sass()
mix.sass()
mix.sass()

mix.sass('app.scss', 'public/css/_app.css');

mix.styles([
    '../../../public/css/_app.css',
    '../../../public/css/styles.css',
], 'public/css/app.css');

V
Vitaly Mosin, 2017-08-20
@c_i_h

I understand that this is necroposting, but still...
As an option, collect all the necessary css and scss in the app.scss file in the right order and then compile it into a mix.

A
Alex Wells, 2017-02-06
@Alex_Wells

In a rush of code, I realized that webpack only fires once. This is not a task builder. For this reason, I will return to gulp and the good old elixir. Thanks to all.
PS: if someone still has a solution - write))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question