Laravel-mix :使用 `mix.js` 或 `mix.scripts`

Laravel-mix : using `mix.js` or `mix.scripts`

使用 Laravel 5.5 我正在使用 laravel-mix 来编译我的资产。

但是我不清楚:mix.jsmix.scripts 之间有什么区别,为什么我要使用一个而不是另一个?

Mix.scripts 将

...combine and minify any number of JavaScript files... This option is particularly useful for legacy projects where you don't require Webpack compilation for your JavaScript.

虽然 mix.js 将编译 ES2015,捆绑模块(如果有)并编译 vue 组件。