New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/transformer-css

Package Overview
Dependencies
Maintainers
1
Versions
898
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-css - npm Package Compare versions

Comparing version 2.0.0-alpha.3.1 to 2.0.0-nightly.65

22

lib/CSSTransformer.js

@@ -10,2 +10,4 @@ "use strict";

var _utils = require("@parcel/utils");
var _postcss = _interopRequireDefault(require("postcss"));

@@ -104,3 +106,4 @@

moduleSpecifier,
loc: rule.source.start,
// Offset by 8 as it does not include `@import `
loc: (0, _utils.createDependencyLocation)(rule.source.start, moduleSpecifier, 0, 8),
meta: {

@@ -120,8 +123,9 @@ media

parsed.walk(node => {
if (node.type === 'function' && node.value === 'url' && node.nodes.length) {
node.nodes[0].value = asset.addURLDependency(node.nodes[0].value, {
loc: decl.source.start
});
isDirty = true;
}
if (node.type === 'function' && node.value === 'url' && node.nodes.length > 0 && !node.nodes[0].value.startsWith('#') // IE's `behavior: url(#default#VML)`
) {
node.nodes[0].value = asset.addURLDependency(node.nodes[0].value, {
loc: (0, _utils.createDependencyLocation)(decl.source.start, node.nodes[0].value)
});
isDirty = true;
}
});

@@ -148,3 +152,5 @@

_postcss.default.stringify(asset.ast.program, c => code += c);
_postcss.default.stringify(asset.ast.program, c => {
code += c;
});
}

@@ -151,0 +157,0 @@

{
"name": "@parcel/transformer-css",
"version": "2.0.0-alpha.3.1",
"version": "2.0.0-nightly.65+53632227",
"license": "MIT",

@@ -19,3 +19,4 @@ "publishConfig": {

"dependencies": {
"@parcel/plugin": "^2.0.0-alpha.3.1",
"@parcel/plugin": "^2.0.0-nightly.65+53632227",
"@parcel/utils": "^2.0.0-nightly.65+53632227",
"postcss": "^7.0.5",

@@ -25,3 +26,3 @@ "postcss-value-parser": "^3.3.1",

},
"gitHead": "291f3e6815a1a857a6165fafb1691ceeb878b8f6"
"gitHead": "53632227bab3382066ed9c40456f54af9fa5614c"
}

@@ -6,2 +6,3 @@ // @flow

import {Transformer} from '@parcel/plugin';
import {createDependencyLocation} from '@parcel/utils';
import postcss from 'postcss';

@@ -45,4 +46,4 @@ import valueParser from 'postcss-value-parser';

program: postcss.parse(code, {
from: asset.filePath
})
from: asset.filePath,
}),
};

@@ -93,6 +94,7 @@ },

moduleSpecifier,
loc: rule.source.start,
// Offset by 8 as it does not include `@import `
loc: createDependencyLocation(rule.source.start, moduleSpecifier, 0, 8),
meta: {
media
}
media,
},
};

@@ -115,6 +117,10 @@ asset.addDependency(dep);

node.value === 'url' &&
node.nodes.length
node.nodes.length > 0 &&
!node.nodes[0].value.startsWith('#') // IE's `behavior: url(#default#VML)`
) {
node.nodes[0].value = asset.addURLDependency(node.nodes[0].value, {
loc: decl.source.start
loc: createDependencyLocation(
decl.source.start,
node.nodes[0].value,
),
});

@@ -141,9 +147,11 @@ isDirty = true;

code = '';
postcss.stringify(asset.ast.program, c => (code += c));
postcss.stringify(asset.ast.program, c => {
code += c;
});
}
return {
code
code,
};
}
},
});
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