Socket
Socket
Sign inDemoInstall

postcss-url

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-url - npm Package Compare versions

Comparing version 9.0.0 to 10.0.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

# 10.0.0 - 2020-10-23
Added: support for PostCSS 8 ([PR#148](https://github.com/postcss/postcss-url/pull/148))
Fixed: path resolution when to/from paths match ([PR#136](https://github.com/postcss/postcss-url/pull/136))
# 9.0.0 - 2019-04-17
Fixed: Async API
Added: support for PostCSS 8
# 8.0.0 - 2018-08-09

@@ -2,0 +12,0 @@

9

package.json
{
"name": "postcss-url",
"version": "9.0.0",
"version": "10.0.0",
"description": "PostCSS plugin to rebase or inline on url().",

@@ -23,3 +23,3 @@ "keywords": [

"engines": {
"node": ">=6.0.0"
"node": ">=10"
},

@@ -30,3 +30,2 @@ "dependencies": {

"mkdirp": "0.5.0",
"postcss": "7.0.2",
"xxhashjs": "0.2.1"

@@ -39,4 +38,8 @@ },

"npmpub": "4.1.0",
"postcss": "8.1.2",
"postcss-import": "12.0.0"
},
"peerDependencies": {
"postcss": "8.1.2"
},
"scripts": {

@@ -43,0 +46,0 @@ "lint": "eslint --fix .",

@@ -13,3 +13,3 @@ # postcss-url

```console
$ npm install postcss-url
$ npm install postcss postcss-url
```

@@ -16,0 +16,0 @@

'use strict';
const path = require('path');
const postcss = require('postcss');
const declProcessor = require('./lib/decl-processor').declProcessor;
/**
*
* @type {Plugin}
*/
module.exports = postcss.plugin('postcss-url', (options) => {
const plugin = (options) => {
options = options || {};
return function(styles, result) {
const promises = [];
const opts = result.opts;
const from = opts.from ? path.dirname(opts.from) : '.';
const to = opts.to ? path.dirname(opts.to) : from;
return {
postcssPlugin: 'postcss-url',
Once(styles, { result }) {
const promises = [];
const opts = result.opts;
const from = opts.from ? path.dirname(opts.from) : '.';
const to = opts.to ? path.dirname(opts.to) : from;
styles.walkDecls((decl) =>
promises.push(declProcessor(from, to, options, result, decl))
);
styles.walkDecls((decl) =>
promises.push(declProcessor(from, to, options, result, decl))
);
return Promise.all(promises);
return Promise.all(promises);
}
};
});
};
plugin.postcss = true;
module.exports = plugin;
/**

@@ -30,0 +32,0 @@ * @callback PostcssUrl~UrlProcessor

@@ -60,3 +60,3 @@ 'use strict';

const getTargetDir = (dir) =>
dir.from !== dir.to ? dir.to : process.cwd();
dir.to != null ? dir.to : process.cwd();

@@ -63,0 +63,0 @@ /**

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc