Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elixir versioning with SCSS and JavaScript

How do I chain Elixir's .version() method with others? My gulpfile.js looks like this:

elixir(function(mix) {
    mix.sass("frontend/frontend.scss", "public/css/app.css")
       .sass("backend/backend.scss", "public/css/admin.css")
       .scripts(js, "public/js/app.js");
});

Do I just call .version() after this chain on my generated files? Like this:

elixir(function(mix) {
    mix.sass("frontend/frontend.scss", "public/css/app.css")
       .sass("backend/backend.scss", "public/css/admin.css")
       .scripts(js, "public/js/app.js")
       .version(["public/css/app.css", "public/css/admin.css", "public/js/app.js"]);
});

Or is there some way to combine .sass() and .scripts() methods with .version() to avoid repeating file names?

Another problem with my example is that it produces redundant unversioned files prior to creating versioned ones, so I have useless files there.

like image 559
Robo Robok Avatar asked Sep 09 '26 21:09

Robo Robok


1 Answers

You said it. The only way to version based on what the laravel docs says is too chain .version([path_to_public_file]). If you would like to make sure for yourself, the docs are here: https://laravel.com/docs/5.0/elixir.

like image 143
Dastur Avatar answered Sep 12 '26 10:09

Dastur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!