Package Exports
- css-url-parser
- css-url-parser/index.js
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 (css-url-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Introduction
Parse urls from css file
Installation
npm install css-url-parserUsage
var parseCssUrls = require('css-url-parser');
var css = '@import "a.css"; .image { background-image: url(images/img.png); }';
var cssUrls = parseCssUrls(css);
console.log(cssUrls); // [ 'a.css', 'images/img.png' ]It ignores duplicated urls and base64 encoded resources. If no urls found empty array will be returned.