@parcel/transformer-css
Advanced tools
Comparing version 2.0.0-alpha.3.1 to 2.0.0-nightly.65
@@ -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, | ||
}; | ||
} | ||
}, | ||
}); |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
10812
260
5
4
1