简体   繁体   中英

Laravel Elixir watch not working properly

So when I create a new Laravel project, gulp watch worked very perfectly. Now I'm working on PyroCMS project which is also used Laravel and the gulp watch kinda fails. I don't know why. It seems to have a problem with watching multiple sass files at the same time. It does not watch at all. However, with one sass file, it works perfectly. Here is my code:

var sassPath    = './addons/dscms/anomaly/generali-theme/resources/sass/',
    cssPath     = './addons/dscms/anomaly/generali-theme/resources/css/',
    jsPath      =   './addons/dscms/anomaly/generali-theme/resources/js/',
    jsCopyPath      =   './addons/dscms/anomaly/generali-theme/resources/js/my-js/';

elixir(mix => {
mix
.sass([
    ''+sassPath+'main-style.sass',
    ''+sassPath+'section1.sass',
    ''+sassPath+'section2.sass'
    ], ''+cssPath+'main.css')
.scripts([
    ''+jsPath+'main.js',
    ''+jsPath+'main-2.js',
    ''+jsPath+'main-3.js'
],''+jsCopyPath+'main.js');
});

It also work with multiple js files but not sass files. Please help me with this one. Thank you very much!

I'm sorry for that. That was completely my fault :) The syntax was a little bit wrong there. The correct code is like this

mix
.sass(''+sassPath+'*.*', ''+cssPath+'main.css')

and I tested it. It watched multiple files and concatenated into one file. Worked perfectly!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM