JSPM

purify-css-inliner

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q21126F
  • License MIT

Find only used CSS from HTML and inline it

Package Exports

  • purify-css-inliner

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

Readme

to install:

npm install purify-css-inliner

using the library:

via command line:

purifycssinliner <filename>.html

can also be used as a package:

let purify = require('purify-css'),
  inliner = require('../src/purifycssinliner')(purify)
inliner(process.argv[2], (output) => {})

what it do:

this gathers css from link tags on an HTML file, concatenates them together, and passes everything to the purify-css library. then the output is inserted into the page as critical css