refactor: load preload script directly as a string (#27546)

This commit is contained in:
Milan Burda 2021-02-08 18:32:20 +01:00 committed by GitHub
parent fa09183ed1
commit bc7c290601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ const getPreloadScript = async function (preloadPath: string) {
let preloadSrc = null; let preloadSrc = null;
let preloadError = null; let preloadError = null;
try { try {
preloadSrc = (await fs.promises.readFile(preloadPath)).toString(); preloadSrc = await fs.promises.readFile(preloadPath, 'utf8');
} catch (error) { } catch (error) {
preloadError = error; preloadError = error;
} }