(entry, plus)
| 33 | ]; |
| 34 | |
| 35 | async function bundleCSSEntry(entry, plus) { |
| 36 | const src = absolutePath(entry.src); |
| 37 | const srcDir = path.dirname(src); |
| 38 | |
| 39 | let input = await readFile(src); |
| 40 | if (!plus) { |
| 41 | const startToken = '/* @plus-start */'; |
| 42 | const endToken = '/* @plus-end */'; |
| 43 | const startIndex = input.indexOf(startToken); |
| 44 | const endIndex = input.indexOf(endToken, startIndex); |
| 45 | if (startIndex >= 0 && endIndex >= 0) { |
| 46 | input = input.substring(0, startIndex) + input.substring(endIndex + endToken.length); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | const output = await less.render(input, {paths: [srcDir], math: 'always'}); |
| 51 | entry.watchFiles = output.imports; |
| 52 | return output.css; |
| 53 | } |
| 54 | |
| 55 | async function writeFiles(dest, platforms, debug, css) { |
| 56 | const enabledPlatforms = Object.values(PLATFORM).filter((platform) => platform !== PLATFORM.API && platforms[platform]); |
no test coverage detected