postcss-extract-asset

1.0.1 • Public • Published

PostCSS Extract Asset

PostCSS plugin to copy assets referenced by url()s into a destination directory.

Install

npm install --save postcss precss postcss-extract-asset

Usage

const postcss = require('postcss');
const precss = require('precss');
const postcssExtractAsset = require('postcss-extract-asset');

const fs = require('fs');

const inFile = 'src/main.css';
const outFile = 'dist/main.css';

postcss([precss, postcssExtractAsset])
    .process(fs.readFileSync(inFile, 'utf8'), {
        from: inFile, 
        to: outFile
    })
    .then(function (result) {
        fs.writeFileSync(outFile, result.css);
    });

Readme

Keywords

Package Sidebar

Install

npm i postcss-extract-asset

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.52 kB

Total Files

6

Last publish

Collaborators

  • pierredavidbelanger