Laravel-mix: Files not being versioned

Created on 14 Jul 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.2.2
  • Node Version: 8.1.3
  • NPM Version : 5.03
  • OS: Mac Sierra
  • Fresh Laravel Install: 5.4.28

Description:

I might be misunderstanding something here so please forgive me if that is the case. I'm fairly new to webpack.
The actual files are not being saved with a version query string at the end of it when I enable versioning. So app.scss after running the build script with versioning enabled is still just app.css in the public directory. I was expecting something like app.css?3443242. The mix-manifest.json file updates correctly with the hashed version name of the file however. Is that the way it's supposed to work. I thought the file name is hashed, and the mix-manifest helps point to the right asset. Otherwise what's the point of using the mix function?

Steps To Reproduce:

webpack.mix.js

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .version();

mix-manifest.json

{
    "/js/app.js": "/js/app.js?id=0c056940c85b0701fe6e",
    "/css/app.css": "/css/app.css?id=3ede8f2085da46f757cf"
}

Outputted File Names
public/js/app.js

public/css/app.css

Most helpful comment

From the change log of version 1.0.0:

File versioning has been simplified. When using mix.version(), no longer will we version the file name, itself. Instead, we'll generate an md5 of the file's contents, and apply it as a query string to the generated mix-manifest.json file. If using a service like Cloudflare, please ensure that you've enabled querystring-based cache-busting.

Related #920

All 3 comments

From the change log of version 1.0.0:

File versioning has been simplified. When using mix.version(), no longer will we version the file name, itself. Instead, we'll generate an md5 of the file's contents, and apply it as a query string to the generated mix-manifest.json file. If using a service like Cloudflare, please ensure that you've enabled querystring-based cache-busting.

Related #920

Oh ok, that makes sense. Thanks.

How can we version the filename and not the hash?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefensuhat picture stefensuhat  路  3Comments

kpilard picture kpilard  路  3Comments

pixieaka picture pixieaka  路  3Comments

mstralka picture mstralka  路  3Comments

dtheb picture dtheb  路  3Comments