1.0.10 • Published 5 years ago

put-version v1.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

put-version

With this tool you can archieve to turn this:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <script src="script.js"></script>
</body>
</html>

to this:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="style.css?version=1.4.0">
</head>

<body>
    <script src="script.js?version=1.4.0"></script>
</body>
</html>

Why?

Browsers cache scripts and stylesheets. When you change the path like this you force the browser to receive the latest versions.

Install

Install it easily with NPM:

npm i put-version -D

Usage

put-version [filePath]

Example: put-version ./index.html

Then you should register it your package.json so it will always get executed when you create a new build:

{
  "name": "your-app",
  "version": "1.0.0",
  "scripts": {
    "build": "put-version ./index.html"
  },
  ...
}
1.0.10

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago