Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm having some trouble with Laravel Elixir and working out in what order things are executed. I've been let to believe that chaining elixir calls will force them to execute synchronously but I've had issues where in certain circumstances certain commands don't seem to execute or appear to execute in an order that means they don't complete properly.

My first issue was that the dependencies.js file was never being versioned by the version() function until I swapped the two scripts() functions round, so the one for dependencies.js ran second.

Another issue is that when I run the tasks through the gulp function, the majority of times, the font-awesome fonts get copied to the build directory. However, when running gulp watch they often get omitted.

I'm able to work around both of these problems, but I keep seeing little things like this that make me think I don't fully understand execution order and subtleties around it. Does anyone know if I'm missing something obvious?

Thanks.

Here's my gulpfile.js code:

mix.sass("app.scss", 'public/css/', {
        includePaths: [paths.bootstrap + 'stylesheets/']
    })
    .scripts([
        'js/app.js'
    ], 'public/js/app.js', paths.assets)
    .scripts([
        // paths.jquery + "dist/jquery.js",
        paths.bootstrap + "javascripts/bootstrap.js",
        paths.assets + "js/freelancer/classie.js",
        paths.assets + "js/freelancer/cbpAnimatedHeader.js",
        paths.assets + "js/freelancer/jqBootstrapValidation.js",
        paths.assets + "js/freelancer/contact_me.js",
        paths.assets + "js/freelancer/freelancer.js"
    ], 'public/js/dependencies.js', './')
    .version([
        'public/js/dependencies.js',
        'public/js/app.js',
        'public/css/app.css'])
    .copy(paths.bootstrap + 'fonts/bootstrap/**', 'public/build/fonts')
    .copy(paths.assets + 'fonts/font-awesome/', 'public/build/fonts');
share|improve this question
    
I think Elixir doesn't implement this feature yet. Take a look at this: github.com/gulpjs/gulp/blob/master/docs/recipes/…. I think you'll have to hack elixir or use just gulp to achieve what you want. You can take the Elixir ingredients and use them outside elixir. –  Aladin Bouzerd Mar 22 at 14:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.