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 CHANGED
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](https://semver.org/).
3
3
 
4
+ ## 8.2.8
5
+ * Fixed browser builds in webpack 4 (by Matt Jones).
6
+
4
7
  ## 8.2.7
5
8
  * Fixed browser builds in webpack 5 (by Matt Jones).
6
9
 
@@ -47,6 +47,8 @@ export default class CssSyntaxError {
47
47
  plugin?: string
48
48
  )
49
49
 
50
+ stack: string
51
+
50
52
  /**
51
53
  * Always equal to `'CssSyntaxError'`. You should always check error type
52
54
  * by `error.name === 'CssSyntaxError'`
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 (/^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) {
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
- let map = new PreviousMap(this.css, opts)
41
- if (map.text) {
42
- this.map = map
43
- let file = map.consumer().file
44
- if (!this.file && file) this.file = this.mapResolve(file)
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) {
@@ -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
@@ -5,7 +5,7 @@ let Root = require('./root')
5
5
 
6
6
  class Processor {
7
7
  constructor (plugins = []) {
8
- this.version = '8.2.7'
8
+ this.version = '8.2.8'
9
9
  this.plugins = this.normalize(plugins)
10
10
  }
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.2.7",
3
+ "version": "8.2.8",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"