在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):vincentmac/gulp-fingerprint开源软件地址(OpenSource Url):https://github.com/vincentmac/gulp-fingerprint开源编程语言(OpenSource Language):JavaScript 98.8%开源软件介绍(OpenSource Introduction):gulp-fingerprintInstall$ npm install --save-dev gulp-fingerprint UsageUpdate a source file with fingerprinted assets. var gulp = require('gulp');
var fingerprint = require('gulp-fingerprint');
// rev-manifest.json produced from gulp-rev
var manifest = require('../../dist/rev-manifest');
gulp.task('default', function () {
var options = {
base: 'assets/',
prefix: '//cdn.example.com/',
verbose: true
};
return gulp.src('.tmp/styles/app.css')
.pipe(fingerprint(manifest, options))
.pipe(gulp.dest('dist'));
}); APIfingerprint(manifest, [options])manifestType: Example: {
"images/logo.jpg": "images/logo-2d4a1176.jpg",
"images/some-image.png": "images/some-image-abd84705.png",
"images/some-logo2.png": "images/some-logo2-abd84715.png"
} If a optionsmodeType: Default: Usage: Setting a regexType: Usage: Sets a custom regex to match on your file. _ Note The default regex,
prefixType: Usage: Setting a ...
.pipe(fingerprint(manifest, {prefix: '//cdn.example.com/'}))
...
// Original: `background-image: url("/images/some-logo.png");`
// Replaced: `background-image: url("//cdn.example.com/images/logo-2d4a1176.jpg");` in src file baseType: Usage: Setting a ...
.pipe(fingerprint(manifest, {base: 'assets/'}))
...
// Original: `background-image: url("assets/images/some-logo2.png");`
// Replaced: `background-image: url("images/some-logo2-abd84715.png");` in src file stripType: Usage: Setting a ...
.pipe(fingerprint(manifest, {strip: 'images/'}))
...
// Original: `background-image: url("/images/some-logo2.png");`
// Replaced: `background-image: url("some-logo2-abd84715.png");` in src file verboseType: Usage: Outputs to stdout. [gulp] gulp-fingerprint Found: images/some-logo.png
[gulp] gulp-fingerprint Replaced: background-image: url("//cdn.example.com/images/logo-2d4a1176.jpg"); } License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论