{"id":32610542,"url":"https://github.com/maize-tech/laravel-mix-static-cache-busting","last_synced_at":"2025-10-30T13:50:23.740Z","repository":{"id":61972299,"uuid":"556705650","full_name":"maize-tech/laravel-mix-static-cache-busting","owner":"maize-tech","description":"Add static cache busting to Laravel mix","archived":false,"fork":false,"pushed_at":"2023-07-12T09:38:23.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2023-11-03T18:42:21.951Z","etag":null,"topics":["cache","laravel","laravel-mix-extension","laravel-mix-plugin","laravel-mix-vue","mix","vue"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maize-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null},"funding":{"github":"maize-tech"}},"created_at":"2022-10-24T11:06:04.000Z","updated_at":"2022-10-24T14:57:31.000Z","dependencies_parsed_at":"2023-01-20T19:49:29.689Z","dependency_job_id":null,"html_url":"https://github.com/maize-tech/laravel-mix-static-cache-busting","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/maize-tech/laravel-mix-static-cache-busting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maize-tech%2Flaravel-mix-static-cache-busting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maize-tech%2Flaravel-mix-static-cache-busting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maize-tech%2Flaravel-mix-static-cache-busting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maize-tech%2Flaravel-mix-static-cache-busting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maize-tech","download_url":"https://codeload.github.com/maize-tech/laravel-mix-static-cache-busting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maize-tech%2Flaravel-mix-static-cache-busting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281818074,"owners_count":26566858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","laravel","laravel-mix-extension","laravel-mix-plugin","laravel-mix-vue","mix","vue"],"created_at":"2025-10-30T13:50:22.536Z","updated_at":"2025-10-30T13:50:23.732Z","avatar_url":"https://github.com/maize-tech.png","language":"JavaScript","funding_links":["https://github.com/sponsors/maize-tech"],"categories":[],"sub_categories":[],"readme":"# Laravel Mix Static Cache Busting\n\n\u003ca href=\"https://www.npmjs.com/package/@maize-tech/laravel-mix-static-cache-busting\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@maize-tech/laravel-mix-static-cache-busting.svg\" alt=\"NPM\"\u003e\u003c/a\u003e\n\u003ca href=\"https://npmcharts.com/compare/@maize-tech/laravel-mix-static-cache-busting?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/@maize-tech/laravel-mix-static-cache-busting.svg\" alt=\"NPM\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/@maize-tech/laravel-mix-static-cache-busting\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@maize-tech/laravel-mix-static-cache-busting.svg\" alt=\"NPM\"\u003e\u003c/a\u003e\n\nThis package allows you to simulate Laravel `mix` function, used for cache busting, without the need to use PHP in your project.\n\nThe plugin will grab your static `index.html` file, search for any asset and replace them with all occurrences specified within `mix-manifest.json`.\n\nFor example, if your `index.html` file includes this stylesheet reference:\n\n```html\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/app.css\"\u003e\n```\n\nthe plugin will automatically replace it during the compilation with:\n\n```html\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/app.css?id=fbd7c81ea490324c303c\"\u003e\n```\n\n### Installation\n\nYou can install this package via npm:\n\n```bash\nnpm i @maize-tech/laravel-mix-static-cache-busting --save-dev\n```\n\n### Usage\n\nTo use the package, all you need to do is update your `webpack.mix.js` file and add the `staticCacheBusting` method.\nThe first parameter is the `mix-manifest.json` file path, while the second one is the `index.html` file path.\n\nHere's an example implementation of the method:\n\n```js\nlet mix = require('laravel-mix');\n\nrequire('@maize-tech/laravel-mix-static-cache-busting');\n\nmix\n  // tasks that will generate a mix-manifest.json\n  .staticCacheBusting('./dist/mix-manifest.json', './dist/index.html') // change paths at your discretion\n```\n\n### Troubleshooting\n\nThe plugin isn't working?\nCheck the entry attributes in your `mix-manifest.json` and make sure your html `href` attributes follow the same path.\n\nFor example, if your `mix-manifest.json` file has this attribute for the `app.css` file:\n\n```json\n{\n    \"/app.css\": \"/app.css?id=fbd7c81ea490324c303c\"\n}\n```\n\nthen your `index.html` should reference the file this way:\n\n```html\n\u003c!-- note the slash before app.css --\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/app.css\"\u003e\n```\n\nwhile this will **not** work:\n\n```html\n\u003c!-- initial slash missing! --\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"app.css\"\u003e\n```\n\nAlso, please note that this plugin will replace any entry as-is and anywhere it's placed within the targeted file (index.html).\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/maize-tech/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](https://github.com/maize-tech/.github/security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Francesco Zaniol](https://github.com/francescozaniol)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaize-tech%2Flaravel-mix-static-cache-busting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaize-tech%2Flaravel-mix-static-cache-busting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaize-tech%2Flaravel-mix-static-cache-busting/lists"}