🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

cache-bust-loader

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-bust-loader

Adds cache-bust query params to referenced files

Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
3
-93.48%
Maintainers
1
Weekly downloads
 
Created
Source

Cache-Bust Loader

NPM Greenkeeper badge

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

Keywords

webpack

FAQs

Package last updated on 03 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts