rev-web-assets
Advanced tools
Comparing version 1.3.4 to 1.3.5
@@ -1,2 +0,2 @@ | ||
//! rev-web-assets v1.3.4 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
//! rev-web-assets v1.3.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
@@ -3,0 +3,0 @@ export type Settings = { |
@@ -1,2 +0,2 @@ | ||
//! rev-web-assets v1.3.4 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
//! rev-web-assets v1.3.5 ~~ https://github.com/center-key/rev-web-assets ~~ MIT License | ||
@@ -71,7 +71,8 @@ import chalk from 'chalk'; | ||
assetDetail.usedIn.push(detail.canonical); | ||
const trailingSlashes = /\/*$/; | ||
const absoluteUrl = () => settings.metaContentBase.replace(trailingSlashes, '/') + | ||
assetDetail?.canonicalFolder + '/' + assetDetail?.hashedFilename; | ||
const hashedUri = () => { | ||
const hashed = revWebAssets.hashFilename(uri, assetDetail.hash); | ||
const noBase = !settings.metaContentBase || !pre.startsWith('<meta'); | ||
const trailingSlashes = /\/*$/; | ||
return noBase ? hashed : settings.metaContentBase.replace(trailingSlashes, '/') + hashed; | ||
return noBase ? revWebAssets.hashFilename(uri, assetDetail.hash) : absoluteUrl(); | ||
}; | ||
@@ -78,0 +79,0 @@ return assetDetail?.hash ? pre + hashedUri() + post : matched; |
{ | ||
"name": "rev-web-assets", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "Revision web asset filenames with cache busting content hash fingerprints", | ||
@@ -8,13 +8,7 @@ "license": "MIT", | ||
"module": "dist/rev-web-assets.js", | ||
"main": "dist/rev-web-assets.js", | ||
"types": "dist/rev-web-assets.d.ts", | ||
"exports": "./dist/rev-web-assets.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./dist/rev-web-assets.js" | ||
}, | ||
"./": "./dist/" | ||
}, | ||
"bin": { | ||
@@ -90,16 +84,16 @@ "rev-web-assets": "bin/cli.js" | ||
"@types/fancy-log": "~2.0", | ||
"@types/node": "~20.10", | ||
"@typescript-eslint/eslint-plugin": "~6.17", | ||
"@typescript-eslint/parser": "~6.17", | ||
"add-dist-header": "~1.3", | ||
"assert-deep-strict-equal": "~1.1", | ||
"copy-file-util": "~1.1", | ||
"eslint": "~8.56", | ||
"@types/node": "~20.12", | ||
"@typescript-eslint/eslint-plugin": "~7.7", | ||
"@typescript-eslint/parser": "~7.7", | ||
"add-dist-header": "~1.4", | ||
"assert-deep-strict-equal": "~1.2", | ||
"copy-file-util": "~1.2", | ||
"eslint": "8.57.0", | ||
"jshint": "~2.13", | ||
"mocha": "~10.2", | ||
"mocha": "~10.4", | ||
"rimraf": "~5.0", | ||
"run-scripts-util": "~1.2", | ||
"typescript": "~5.3", | ||
"w3c-html-validator": "~1.6" | ||
"typescript": "~5.4", | ||
"w3c-html-validator": "~1.8" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # rev-web-assets | ||
[](https://www.npmjs.com/package/rev-web-assets) | ||
[](https://github.com/center-key/rev-web-assets/actions/workflows/run-spec-on-push.yaml) | ||
[](https://github.com/center-key/rev-web-assets/actions/workflows/run-spec-on-push.yaml) | ||
@@ -24,3 +24,3 @@ **rev-web-assets** updates the asset filenames of a website to contain a eight-digit hex hash. | ||
## B) Usage | ||
### 1. npm scripts | ||
### 1. npm package.json scripts | ||
Run `rev-web-assets` from the `"scripts"` section of your **package.json** file. | ||
@@ -155,3 +155,3 @@ | ||
- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets): _Revision web asset filenames with cache busting content hash fingerprints_ | ||
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util): _Organize npm scripts into named groups of easy to manage commands_ | ||
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util): _Organize npm package.json scripts into named groups of easy to manage commands_ | ||
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator): _Check the markup validity of HTML files using the W3C validator_ | ||
@@ -158,0 +158,0 @@ |
23419
273