$ cnpm install inlineresources
Inlines style sheets, images, fonts and scripts in HTML documents. Works in the browser.
See the API.
$ npm install inlineresources
and require through browserify or webpack.
Alternatively use a standalone bundle via e.g. https://wzrd.in/standalone/inlineresources@latest.
Resources referenced in the document (CSS, images, fonts and JS) can only be loaded if from the same origin, unless techniques like CORS are used.
Yet to be supported:
<div style="...">
)<link rel="stylesheet" media="..." />
)@import url("...") screen and (orientation:landscape);
)<img srcset="...">
)For linting, tests and a browser build install Node.js and run
$ npm install && npm test
Check ./dist/
for the browserified builds.
To test against several browsers while editing, run grunt testWatch
and point those browsers to http://localhost:9989/
.
Christoph Burgmer. Licensed under MIT. Reach out on Twitter.
Copyright 2013 - present © cnpmjs.org