postcss 8.2.7 → 8.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/CHANGELOG.md +3 -0
- package/lib/css-syntax-error.d.ts +2 -0
- package/lib/input.js +14 -6
- package/lib/map-generator.js +3 -1
- package/lib/processor.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/input.js
CHANGED
@@ -10,6 +10,8 @@ let PreviousMap = require('./previous-map')
|
|
10
10
|
|
11
11
|
let fromOffsetCache = Symbol('fromOffset cache')
|
12
12
|
|
13
|
+
let pathAvailable = Boolean(resolve && isAbsolute)
|
14
|
+
|
13
15
|
class Input {
|
14
16
|
constructor (css, opts = {}) {
|
15
17
|
if (
|
@@ -30,18 +32,24 @@ class Input {
|
|
30
32
|
}
|
31
33
|
|
32
34
|
if (opts.from) {
|
33
|
-
if (
|
35
|
+
if (
|
36
|
+
!pathAvailable ||
|
37
|
+
/^\w+:\/\//.test(opts.from) ||
|
38
|
+
isAbsolute(opts.from)
|
39
|
+
) {
|
34
40
|
this.file = opts.from
|
35
41
|
} else {
|
36
42
|
this.file = resolve(opts.from)
|
37
43
|
}
|
38
44
|
}
|
39
45
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
46
|
+
if (pathAvailable) {
|
47
|
+
let map = new PreviousMap(this.css, opts)
|
48
|
+
if (map.text) {
|
49
|
+
this.map = map
|
50
|
+
let file = map.consumer().file
|
51
|
+
if (!this.file && file) this.file = this.mapResolve(file)
|
52
|
+
}
|
45
53
|
}
|
46
54
|
|
47
55
|
if (!this.file) {
|
package/lib/map-generator.js
CHANGED
@@ -4,6 +4,8 @@ let { dirname, resolve, relative, sep } = require('path')
|
|
4
4
|
let { pathToFileURL } = require('url')
|
5
5
|
let mozilla = require('source-map')
|
6
6
|
|
7
|
+
let pathAvailable = Boolean(dirname, resolve, relative, sep)
|
8
|
+
|
7
9
|
class MapGenerator {
|
8
10
|
constructor (stringify, root, opts) {
|
9
11
|
this.stringify = stringify
|
@@ -275,7 +277,7 @@ class MapGenerator {
|
|
275
277
|
generate () {
|
276
278
|
this.clearAnnotation()
|
277
279
|
|
278
|
-
if (this.isMap()) {
|
280
|
+
if (pathAvailable && this.isMap()) {
|
279
281
|
return this.generateMap()
|
280
282
|
}
|
281
283
|
|
package/lib/processor.js
CHANGED