
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
gulp-make-css-url-version-s
Advanced tools
修改了 gulp-make-css-url-version 增加版本号的方式:
原来的日期模式是"yy-mm-dd" 修改成以毫秒为序列号
原来的MD5模式引用字段过长引起CSS文件过大,现在截取前8位为版本号
解决图片url以域名 ("http://", "https://", "//")为前缀导致找不到文件路径而无法修改版本号问题;
可过滤不需要修改版本号的路径
npm install gulp-make-css-url-version-s
默认MD5模式
var makeUrlVer = require('gulp-make-css-url-version-s');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(makeUrlVer())
.pipe(gulp.dest('dist'))
});
使用日期模式:
var makeUrlVer = require('gulp-make-css-url-version-s');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
//原格式:yy-mm-dd 修改后格式:201711061728(时间拼接精确到毫秒)
.pipe(makeUrlVer({useDate:true}))
.pipe(gulp.dest('dist'))
});
var makeUrlVer = require('gulp-make-css-url-version-s');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(cssver({
/*域名替换,路径必须以'/'结束 ;
例如" http://abc.com/images/logo.png" 用'../'替换后你可以处理的路径是'../images/logo.png' */
domainName:'../',
//过滤不需要加版本号的域名
excludeDomain:["//abc.cn/","http://abc.com/"]}))
.pipe(gulp.dest('dist'))
});
assetsDir: specify the public directory for correct MD5 calculation in some specific cases
var makeUrlVer = require('gulp-make-css-url-version-s');
gulp.task('stylesheets', function() {
gulp.src('css/*.css')
.pipe(makeUrlVer({
assetsDir: __dirname + '/public'
}))
.pipe(gulp.dest('dist'))
});
/* loading */
.i-loading{background:url(../images/loading.gif) ;}
.logo{background:url(//js.abc.com/images/loading.png) ;}
/* loading */
.i-loading{background:url(../images/loading.gif?v=Je0sUcMH)}
.logo{background:url(//js.abc.com/images/logo.png?v=Je0sUcMH) ;}
FAQs
replace version for images in css files
We found that gulp-make-css-url-version-s demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.