Socket
Socket
Sign inDemoInstall

postcss-url

Package Overview
Dependencies
Maintainers
1
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 7.1.2 to 7.2.0

6

CHANGELOG.md

@@ -1,3 +0,7 @@

# 7.1.2 - 2017-08-11
#7.2.0 - 2017-10-17
Added: `assetsPath` option for `rebase`
#7.1.2 - 2017-08-11
Fixed: wrap url by quotes for inlined svg ([#78](https://github.com/postcss/postcss-url/issues/78))

@@ -4,0 +8,0 @@

2

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -138,2 +138,3 @@ # postcss-url

* `rebase` - _default_
* `assetsPath` - directory to copy assets (relative to `to` or absolute)
* `inline`

@@ -140,0 +141,0 @@ * `basePath` - path or array of paths to search assets (relative to `from`, or absolute)

'use strict';
const path = require('path');
const normalize = require('../lib/paths').normalize;
const paths = require('../lib/paths');
const normalize = paths.normalize;
const getAssetsPath = paths.getAssetsPath;

@@ -12,8 +14,10 @@ /**

* @param {PostcssUrl~Dir} dir
* @param {PostcssUrl~Option} options
*
* @returns {String|Undefined}
*/
module.exports = function(asset, dir) {
module.exports = function(asset, dir, options) {
const dest = getAssetsPath(dir.to, options && options.assetsPath || '');
const rebasedUrl = normalize(
path.relative(dir.to, asset.absolutePath)
path.relative(dest, asset.absolutePath)
);

@@ -20,0 +24,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