()
| 101 | } |
| 102 | |
| 103 | generateMap() { |
| 104 | if (this.root) { |
| 105 | this.generateString() |
| 106 | } else if (this.previous().length === 1) { |
| 107 | let prev = this.previous()[0].consumer() |
| 108 | prev.file = this.outputFile() |
| 109 | this.map = SourceMapGenerator.fromSourceMap(prev, { |
| 110 | ignoreInvalidMapping: true |
| 111 | }) |
| 112 | } else { |
| 113 | this.map = new SourceMapGenerator({ |
| 114 | file: this.outputFile(), |
| 115 | ignoreInvalidMapping: true |
| 116 | }) |
| 117 | this.map.addMapping({ |
| 118 | generated: { column: 0, line: 1 }, |
| 119 | original: { column: 0, line: 1 }, |
| 120 | source: this.opts.from |
| 121 | ? this.toUrl(this.path(this.opts.from)) |
| 122 | : '<no source>' |
| 123 | }) |
| 124 | } |
| 125 | |
| 126 | if (this.isSourcesContent()) this.setSourcesContent() |
| 127 | if (this.root && this.previous().length > 0) this.applyPrevMaps() |
| 128 | if (this.isAnnotation()) this.addAnnotation() |
| 129 | |
| 130 | if (this.isInline()) { |
| 131 | return [this.css] |
| 132 | } else { |
| 133 | return [this.css, this.map] |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | generateString() { |
| 138 | this.css = '' |
no test coverage detected