1

I am taking over a laravel project that uses elixir to compile various sass, coffeescript, and javascript files:

elixir(function(mix) {
    mix.sass('main.scss')
        .coffee(['methods.coffee', 'details.coffee', 'cars.coffee', 'context-menu.coffee', 'content.coffee', 'projects.coffee', 'main.coffee'])
        .styles(['main.css'], 'public/css/all.css', 'public/css')
        .scripts(['app.js'], 'public/js/all.js', 'public/js')
        .version(['css/all.css', 'js/all.js']);
}); 

My questions:

What is the destination of the files below after they are compiled?

.coffee(['methods.coffee', 'details.coffee', 'cars.coffee', 'context-menu.coffee', 'content.coffee', 'projects.coffee', 'main.coffee'])

Does the line below compile the app.js file as all.js and store it in public/js?

.scripts(['app.js'], 'public/js/all.js', 'public/js')

Similarly, does the line below compile the main.css file as all.css and store it in public/css?

.styles(['main.css'], 'public/css/all.css', 'public/css')

Thanks in advance!

1 Answer 1

2

By default, the task will place the compiled in:

  • sass = public/css/app.css
  • coffee = public/js/app.js
  • scripts= public/js/all.js
  • styles = public/css/all.css

UPDATE

To change the output path just pass a second argument to the method

e.g.

mix.styles([
    'bundle.css'
], 'public/css/aloha');
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks - so to confirm, .styles(['main.css'], 'public/css/all.css', 'public/css') places changes main.css to all.css and places it in public/css correct?
The second argument is the base output path (public/css/all.css) and the third argument is the base source path (public/css)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.