0

I have a project that has about 10 javascript files. I want to use Laravel mix webpack to combine and version the js files. The files get combined but the versioning is not working. It only works for my scss files. It used to work in Laravel elixir. I checked the mix-manifest.json file in the public directory and this is what I found:

{
  "mix.js": "mix.b2328beb0372c051d06d.js",
  "/css/main.css": "/css/main.bb97b313cc88fe75b545.css",
  "/js/main.js": "/js/main.js"
}

I looked for the mix.js file and I could not find it anywhere in my project.

Here is my webpack.mix.js file:

mix.combine(
    [
        'resources/assets/js/jRespond.js',
        'resources/assets/js/sweetalert.min.js',
        ....
    ]
    , 'public/js/main.js')
    .sass('resources/assets/sass/main.scss', 'public/css/main.css')
    .version();

Thank you

4

2 回答 2

0

版本控制似乎确实不适用于combine方法,但使用该js方法应该可以解决问题:

mix.js(
[
    'resources/assets/js/jRespond.js',
    'resources/assets/js/sweetalert.min.js',
    ....
]
, 'public/js/main.js')
.sass('resources/assets/sass/main.scss', 'public/css/main.css')
.version();
于 2017-03-01T19:44:00.337 回答
0

我找到了解决方案。我只需要将我的 Laravel-mix 更新到更新的版本。Jeffery Way 添加了 mix.combine 和 mix.scripts 的版本控制

于 2017-03-02T19:20:12.797 回答