wishthis/node_modules/rework-plugin-url
2022-04-08 12:55:35 +02:00
..
.npmignore Add production dependencies 2022-01-21 09:28:41 +01:00
.travis.yml Add production dependencies 2022-01-21 09:28:41 +01:00
index.js Add production dependencies 2022-01-21 09:28:41 +01:00
LICENSE Add production dependencies 2022-01-21 09:28:41 +01:00
package.json Install yarn 2022-04-08 12:55:35 +02:00
README.md Add production dependencies 2022-01-21 09:28:41 +01:00

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);
}