在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):trentearl/gulp-css-url-adjuster开源软件地址(OpenSource Url):https://github.com/trentearl/gulp-css-url-adjuster开源编程语言(OpenSource Language):JavaScript 79.6%开源软件介绍(OpenSource Introduction):gulp-css-url-adjusterPlease consider using gulp-reworkhttps://github.com/sindresorhus/gulp-rework This package allows gulp to change css urls css file: .cool-background {
background-image: url('coolImage.jpg');
} var urlAdjuster = require('gulp-css-url-adjuster');
gulp.src('style.css').
pipe(urlAdjuster({
prepend: '/image_directory/',
append: '?version=1',
}))
.pipe(gulp.dest('modifiedStyle.css')); .cool-background {
background-image: url('/image_directory/coolImage.jpg?version=1');
} only adjust relative paths: .cool-background {
background-image: url('coolImage.jpg');
}
.neato-background {
background-image: url('/images/neatoImage.jpg');
} gulp.src('style.css').
pipe(urlAdjuster({
prependRelative: '/image_directory/',
}))
.pipe(gulp.dest('modifiedStyle.css')); .cool-background {
background-image: url('/image_directory/coolImage.jpg');
}
.neato-background {
background-image: url('/images/neatoImage.jpg');
} or replace path to another: .cool-background {
background-image: url('/old/path/coolImage.jpg');
}
.neato-background {
background-image: url('/old/path/images/neatoImage.jpg');
} gulp.src('style.css').
pipe(urlAdjuster({
replace: ['/old/path','/brand/new'],
}))
.pipe(gulp.dest('modifiedStyle.css')); .cool-background {
background-image: url('/brand/new/coolImage.jpg');
}
.neato-background {
background-image: url('/brand/new/images/neatoImage.jpg');
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论