MCPcopy
hub / github.com/postcss/postcss / addAnnotation

Method addAnnotation

lib/map-generator.js:27–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 }
26
27 addAnnotation() {
28 let content
29
30 if (this.isInline()) {
31 content =
32 'data:application/json;base64,' + this.toBase64(this.map.toString())
33 } else if (typeof this.mapOpts.annotation === 'string') {
34 content = this.mapOpts.annotation
35 } else if (typeof this.mapOpts.annotation === 'function') {
36 content = this.mapOpts.annotation(this.opts.to, this.root)
37 } else {
38 content = this.outputFile() + '.map'
39 }
40 let eol = '\n'
41 if (this.css.includes('\r\n')) eol = '\r\n'
42
43 this.css += eol + '/*# sourceMappingURL=' + content + ' */'
44 }
45
46 applyPrevMaps() {
47 for (let prev of this.previous()) {

Callers 1

generateMapMethod · 0.95

Calls 4

isInlineMethod · 0.95
toBase64Method · 0.95
outputFileMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected