How to use the rework.inline function in rework

To help you get started, we’ve selected a few rework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hughsk / disc / lib / bundle-css.js View on Github external
var autoprefixer = require('autoprefixer')('last 2 versions')
  , clean = require('clean-css')
  , rework = require('rework')
  , fs = require('fs')

var css = fs.readFileSync(__dirname + '/../src/style.css', 'utf8')

css = rework(css)
  .use(rework.inline(__dirname + '/../img'))
  .toString()

css = autoprefixer.process(
  css
).css

css = new clean()
  .minify(css)

console.log(css)