Answer the question
In order to leave comments, you need to log in
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');
Answer the question
In order to leave comments, you need to log in
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
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');
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.
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 questionAsk a Question
731 491 924 answers to any question