Search code examples
angularjslaravelgulplaravel-elixir

Laravel AngularJs automate urls


How could I make this work in gulp / elixer :

Right now In my angularJs project I put everything manually in my index.html like this:

<script src="angular/controllers/indexController.js"></script>
<script src="angular/controllers/schoolController.js"></script>

How could I automate this with gulp / elixer?

Already tried things like this:

mix.scripts([
    'app.js',
    'controllers/**/*.js',
    'services/**/*.js',
    'directives/**/*.js'
]);

But that's obviously not working

Thankyou


Solution

  • Try the following:

    mix.scripts([
        'app.js',
        'controllers',
        'services',
        'directives'
    ]);
    

    I discovered that if you don't have an extension, elixir will check for scripts in the folder by default.