* Returns compiled file to prepend within wrapper and empty string if none. * * @param {string} srcFilename * @return {Promise }
(srcFilename)
| 176 | * @return {Promise<string>} |
| 177 | */ |
| 178 | async function getCompiledFile(srcFilename) { |
| 179 | const bundleFiles = EXTENSION_BUNDLE_MAP[srcFilename]; |
| 180 | if (!bundleFiles) { |
| 181 | return ''; |
| 182 | } |
| 183 | const filesContents = await Promise.all( |
| 184 | bundleFiles.map((file) => fs.readFile(file, 'utf8')) |
| 185 | ); |
| 186 | return filesContents.join('\n'); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * @param {string} name |