* 'Jsify' a CSS file - Adds vendor specific css prefixes to the css file, * compresses the file, removes the copyright comment, and adds the sourceURL * to the stylesheet * * @param {string} filename css file * @return {!Promise } that resolves with the css content after * processing
(filename)
| 99 | * processing |
| 100 | */ |
| 101 | async function jsifyCssAsync(filename) { |
| 102 | const {contents, hash: filehash} = await batchedRead(filename); |
| 103 | const imports = await getCssImports(filename); |
| 104 | const importHashes = await Promise.all( |
| 105 | imports.map(async (importedFile) => (await batchedRead(importedFile)).hash) |
| 106 | ); |
| 107 | const hash = md5(filehash, ...importHashes, await getEnvironmentHash()); |
| 108 | const result = await transformCss(contents, hash, filename); |
| 109 | |
| 110 | result.warnings.forEach((warn) => log(red(warn))); |
| 111 | return result.css + '\n/*# sourceURL=/' + filename + '*/'; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Computes the transitive closure of CSS files imported by the given file. |
no test coverage detected