postcss-url
Advanced tools
Comparing version 9.0.0 to 10.0.0
@@ -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 @@ |
{ | ||
"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 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40976
6
+ Addedcolorette@1.4.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.0(transitive)
+ Addedline-column@1.0.2(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpostcss@8.1.2(transitive)
- Removedpostcss@7.0.2
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedpostcss@7.0.2(transitive)
- Removedsupports-color@5.5.0(transitive)