JSPM

rework-plugin-url

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23619
  • Score
    100M100P100Q142584F
  • License MIT

url() plugin for rework, formerly included in core

Package Exports

  • rework-plugin-url

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 (rework-plugin-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rework-plugin-url

Build Status

Map url() calls. Replace all url()s using a given function.

var css = rework(read(css))
  .use(rework.url(function(url){
    return 'http://example.com' + url;
  }))
  .toString()
body {
  background: url(/images/bg.png);
}

yields:

body {
  background: url(http://example.com/images/bg.png);
}