# cache-bust-loader

> Adds cache-bust query params to referenced files

Latest version **1.0.7** (published 2020-12-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cache-bust-loader
pnpm add cache-bust-loader
yarn add cache-bust-loader
bun add cache-bust-loader
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2020-12-09 |
| First published | 2017-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christian Kotzbauer |
| Maintainers | code-chris |
| Keywords | webpack, cache, bust, busting, cache-bust, cache-busting, loader, webpack-loader |

## Links

- npm: https://www.npmjs.com/package/cache-bust-loader
- Repository: https://github.com/ckotzbauer/cache-bust-loader
- Homepage: https://github.com/ckotzbauer/cache-bust-loader#readme
- Issues: https://github.com/ckotzbauer/cache-bust-loader/issues
- npm.io page: https://npm.io/package/cache-bust-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) ~2.0.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2020-12-09
- 1.0.6 — 2020-07-04
- 1.0.5 — 2017-07-24
- 1.0.4 — 2017-04-03
- 1.0.3 — 2017-03-11
- 1.0.2 — 2017-03-11
- 1.0.1 — 2017-01-21
- 1.0.0 — 2017-01-17

## README

# Cache-Bust Loader

[![NPM](https://img.shields.io/npm/v/cache-bust-loader.svg)](https://www.npmjs.com/package/cache-bust-loader)


This Webpack loader adds a cache-bust query parameter to referenced files in your source code.


## Installation

```
npm install cache-bust-loader
```


## Usage

Add this to your webpack.config.js to apply the logic to your .css files for example.

### Webpack 1

```js
module.exports = {
  ...
  module: {
    loaders: [
	  { test: /\.css$/, loader: "cache-bust-loader?name=bust&value=ZZxTE!css-loader" }
	]
  }
  ...
};
```

### Webpack 2

```js
module.exports = {
  ...
  module: {
    rules: [
	  { test: /\.css$/, loader: "cache-bust-loader?name=bust&value=ZZxTE!css-loader" }
	]
  }
  ...
};
```

## Configuration

The following parameters are possible:

| Parameter   | Mandatory | Data type | Default value                                        |
|-------------|-----------|-----------|------------------------------------------------------|
| `name`      | True      | String    |                                                      |
| `value`     | False     | String    |                                                      |
| `types`     | False     | String    | eot;woff;woff2;svg;ttf;otf;jpg;jpeg;png;ico;gif;json |

The `name` describes the name of the query parameter, the `value` the string which should change every build. If the `value` is empty, no parameters are applied (e.g. in development mode). The `types` are filetypes
which you want to be cache-busted. Split them with a semicolon.


[License](https://github.com/ckotzbauer/cache-bust-loader/blob/master/LICENSE)
------

---
_Source: https://npm.io/package/cache-bust-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
