For example, if I want to use only sass mix it will fail:
mix.sass('resources/assets/sass/app.scss', 'public/css/app.css')
Error:
./node_modules/laravel-mix/src/Mix.js:70
let entry = this.js.reduce((result, paths) => {
^
TypeError: Cannot read property 'reduce' of undefined
If js mix is included , when everything is OK:
mix.js('resources/assets/js/app.js', 'public/js/test.js')
.sass('resources/assets/sass/app.scss', 'public/css/app.css')
It looks like you must always include js mix
@DarkaOnLine Because this uses Webpack, some form of JavaScript bundling is required. - Jeffrey Way
Jup it makes sense :) Webpack can't work without entry...
Are there any plans to make this fail more gracefully? It seems like a harsh way of dealing with an undocumented requirement.
Yeah we might want a better error or documentation about it. Have been getting messages on Twitter about this.
It's both documented and listed in the error output.
"Error: Laravel Mix: You must call "mix.js()" once or more."
Update: I've pushed a new version that will allow you to do mix.sass() without ever calling mix.js(). It'll just create the entry for you.
Most helpful comment
Update: I've pushed a new version that will allow you to do
mix.sass()without ever callingmix.js(). It'll just create the entry for you.