summaryrefslogtreecommitdiff
path: root/node_modules/postcss/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/postcss/lib')
-rw-r--r--node_modules/postcss/lib/map-generator.js5
-rw-r--r--node_modules/postcss/lib/no-work-result.js3
-rw-r--r--node_modules/postcss/lib/processor.js10
3 files changed, 11 insertions, 7 deletions
diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js
index 523b4639..b5da1642 100644
--- a/node_modules/postcss/lib/map-generator.js
+++ b/node_modules/postcss/lib/map-generator.js
@@ -16,6 +16,7 @@ class MapGenerator {
this.root = root
this.opts = opts
this.css = cssString
+ this.originalCSS = cssString
this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
this.memoizedFileURLs = new Map()
@@ -74,7 +75,7 @@ class MapGenerator {
}
}
} else if (this.css) {
- this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, '')
+ this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, '')
}
}
@@ -276,7 +277,7 @@ class MapGenerator {
}
})
} else {
- let input = new Input(this.css, this.opts)
+ let input = new Input(this.originalCSS, this.opts)
if (input.map) this.previousMaps.push(input.map)
}
}
diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js
index a0609f79..aa3fdb4e 100644
--- a/node_modules/postcss/lib/no-work-result.js
+++ b/node_modules/postcss/lib/no-work-result.js
@@ -37,6 +37,9 @@ class NoWorkResult {
if (generatedMap) {
this.result.map = generatedMap
}
+ } else {
+ map.clearAnnotation();
+ this.result.css = map.css;
}
}
diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js
index 0629eb4f..9d6a5acd 100644
--- a/node_modules/postcss/lib/processor.js
+++ b/node_modules/postcss/lib/processor.js
@@ -7,7 +7,7 @@ let Root = require('./root')
class Processor {
constructor(plugins = []) {
- this.version = '8.4.32'
+ this.version = '8.4.33'
this.plugins = this.normalize(plugins)
}
@@ -43,10 +43,10 @@ class Processor {
process(css, opts = {}) {
if (
- this.plugins.length === 0 &&
- typeof opts.parser === 'undefined' &&
- typeof opts.stringifier === 'undefined' &&
- typeof opts.syntax === 'undefined'
+ !this.plugins.length &&
+ !opts.parser &&
+ !opts.stringifier &&
+ !opts.syntax
) {
return new NoWorkResult(this, css, opts)
} else {