( type: 'js' | 'css', code: string, map: SourceMap, )
| 141 | } |
| 142 | |
| 143 | export function getCodeWithSourcemap( |
| 144 | type: 'js' | 'css', |
| 145 | code: string, |
| 146 | map: SourceMap, |
| 147 | ): string { |
| 148 | if (debug) { |
| 149 | code += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n` |
| 150 | } |
| 151 | |
| 152 | if (type === 'js') { |
| 153 | code += `\n//# sourceMappingURL=${genSourceMapUrl(map)}` |
| 154 | } else if (type === 'css') { |
| 155 | code += `\n/*# sourceMappingURL=${genSourceMapUrl(map)} */` |
| 156 | } |
| 157 | |
| 158 | return code |
| 159 | } |
| 160 | |
| 161 | export function applySourcemapIgnoreList( |
| 162 | map: ExistingRawSourceMap, |
no test coverage detected