Skip to content

Deleting stale hashed files #6

@juddlyon

Description

@juddlyon

Hi Ben!

Thanks for creating this, I needed a replacement for laravel-mix-versionhash. Gonna check out your Agency set up soon.

I'm not able to delete the stale hashed files with force set to true in delOptions. Here's the output with debug turned on:

Manifest found: '../web/dist/mix-manifest.json'
Renamed '../web/dist/js/app.js' to '../web/dist/js/app.b1e46e01a3c3a84c3cd6.js' (delOptions '{"force":true}')
Renamed '../web/dist/css/app.css' to '../web/dist/css/app.36b4410866e3e76ee304.css' (delOptions '{"force":true}')
Finished updating '../web/dist/mix-manifest.json' with the new filenames:
 {
  '/js/app.js': '/js/app.b1e46e01a3c3a84c3cd6.js',
  '/css/app.css': '/css/app.36b4410866e3e76ee304.css'
}

The built files from previous runs are still there. Not a biggie but I'd like to nuke them.

The invocation:

if (mix.inProduction()) {
  mix.version();
  mix.then(() => {
    convertToFileHash({
      publicPath: '../web/dist',
      manifestFilePath: '../web/dist/mix-manifest.json',
      delOptions: { force: true },
      debug: true
    });
  });
}

Here are the versions I'm using:

  "devDependencies": {
    "laravel-mix": "^6.0.11",
    "laravel-mix-make-file-hash": "^2.2.0",
    "laravel-mix-purgecss": "^6.0.0",
    "postcss": "^8.2.4",
    "resolve-url-loader": "^3.1.2",
    "sass": "^1.32.5",
    "sass-loader": "^8.0.2"
  }

Please advise. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions