1.0.7 • Published 3 years ago

cache-bust-loader v1.0.7

Weekly downloads
244
License
MIT
Repository
github
Last release
3 years ago

Cache-Bust Loader

NPM

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

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

Webpack 2

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

Configuration

The following parameters are possible:

ParameterMandatoryData typeDefault value
nameTrueString
valueFalseString
typesFalseStringeot;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

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago