
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-rebase-css-urls
Advanced tools
A Gulp plugin for bundling js and css resources as an external reference.
The plugin is minimalistic and simple. It rebases a chosen css files stream urls to a new base url.
+ src
- file.css
+ fldr
- image.jpg
- file2.css
Where 'file.css' contents are:
.a{
background-image: url("fldr/image.jpg");
}
and 'file2.css' contents are:
.b{
background-image: url("image.jpg");
}
And the task:
var rebaseCssUrls = require('gulp-rebase-css-urls'),
concat = require('gulp-concat');
gulp.task('concat-css-files', ['copy-image-file'], function(){
return gulp.src('src/**/*.css')
.pipe(rebaseCssUrls(srcDir))
.pipe(concat('bundle.css'))
.pipe(gulp.dest(dstDir));
});
Results in a directory like so:
+ dst
- bundle.css
+ fldr
- image.jpg
And a bundle.css contents like so:
.a{
background-image: url("fldr/image.jpg");
}
.b{
background-image: url("fldr/image.jpg");
}
rebaseCssUrls(base)
Type: String
The new base url, comparing to initial file's src.
Running the gulp file would concat tests/input
files into tests/actual
and compare the results to a static tests/expected
directory, and make sure we got what we've expected.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.
FAQs
A gulp plugin for rebasing all css urls.
The npm package gulp-rebase-css-urls receives a total of 96 weekly downloads. As such, gulp-rebase-css-urls popularity was classified as not popular.
We found that gulp-rebase-css-urls 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.