|
1 | 1 | import { Syntax } from "../BlockParser";
|
2 | 2 | import { ResolvedConfiguration } from "../configuration";
|
3 |
| -import { REGEXP_COMMENT_DEFINITION_REF, REGEXP_COMMENT_FOOTER, REGEXP_COMMENT_HEADER, REGEXP_SOURCEMAP_COMMENT } from "../PrecompiledDefinitions/compiled-comments"; |
| 3 | +import { REGEXP_COMMENT_DEFINITION_REF, REGEXP_COMMENT_FOOTER, REGEXP_COMMENT_HEADER } from "../PrecompiledDefinitions/compiled-comments"; |
4 | 4 |
|
5 | 5 | import { FileIdentifier, ImportedCompiledCssFile, ImportedCompiledCssFileContents, ImportedFile, Importer } from "./Importer";
|
6 | 6 |
|
@@ -103,32 +103,14 @@ export abstract class BaseImporter implements Importer {
|
103 | 103 | }
|
104 | 104 | const [definitionFullMatch, definitionUrl] = definitionRegexpResult;
|
105 | 105 | const blockCssContents = fullBlockContents.replace(definitionFullMatch, "");
|
106 |
| - const blockContentsWithSourcemap = this.mergeSourcemapIntoCompiledCssContents(blockCssContents, post); |
107 | 106 |
|
108 | 107 | return {
|
109 | 108 | pre,
|
110 | 109 | blockId,
|
111 |
| - blockCssContents: blockContentsWithSourcemap, |
| 110 | + blockCssContents, |
112 | 111 | definitionUrl,
|
113 | 112 | post,
|
| 113 | + raw: contents, |
114 | 114 | };
|
115 | 115 | }
|
116 |
| - |
117 |
| - /** |
118 |
| - * Look for sourcemap data in given post-blocks content. If found, append it to the given CSS contents. |
119 |
| - * @param cssContents - The CSS contents of the Compiled CSS file (what appears between the CSS Blocks comments). |
120 |
| - * @param postContent - Content that appears in the content after the closing CSS Blocks comment. |
121 |
| - * @returns The CSS Contents with sourcemap appended, if found. Returns CSS contents alone if not found. |
122 |
| - */ |
123 |
| - private mergeSourcemapIntoCompiledCssContents(cssContents: string, postContent: string) { |
124 |
| - const sourcemapRegexpResult = postContent.match(REGEXP_SOURCEMAP_COMMENT); |
125 |
| - |
126 |
| - // No sourcemap? Just return the CSS contents. |
127 |
| - if (sourcemapRegexpResult === null) { |
128 |
| - return cssContents; |
129 |
| - } |
130 |
| - |
131 |
| - // Otherwise, append the sourcemap to the end of the CSS contents. |
132 |
| - return `${cssContents}\n${sourcemapRegexpResult[0]}`; |
133 |
| - } |
134 | 116 | }
|
0 commit comments