JSPM

gulp-cssretarget

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q44633F
  • License MIT

Retarget relative CSS URLs during asset rebasing.

Package Exports

  • gulp-cssretarget

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-cssretarget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-cssretarget

Retarget relative CSS URLs during asset rebasing.

Install

npm install gulp-cssretarget --save

Example usage

var cssRetarget = require('gulp-cssretarget');
var useref = require('gulp-useref');
var concat = require('gulp-concat');
...

var userefAssets = useref.assets({
  noconcat: true // preserve paths for gulp-cssretarget
});

// retargets relative URLs when moving from www to dist
return gulp.src('www/index.html')
  .pipe(userefAssets)
  .pipe(gulpif('**/*.css', cssRetarget({ root: 'www' })))
  .pipe(gulpif('**/*.css', concat('style.css')))
  .pipe(userefAssets.restore())
  .pipe(gulp.dest('dist'));

Options

options.root

Type: String Default value: ''

The new directory root relative to which your assets will live.

options.prepend

Type: String Default value: ''

String prepended to each asset URL.

Release History

1.1.0

Add prepend option

1.0.0

Initial release

Originally forked from gulp-css-rebase-urls