async function getReadFileReplacement(node, filepath) {
  assertEqualString(node.callee.type, 'MemberExpression');
  assertEqualString(node.callee.property.type, 'Identifier');
  assert.equal(node.callee.property.name, 'readFileSync');

  assert.equal(node.arguments.length, 2, 'fs.readFileSync() must have two arguments');
  const constructedPath = collapseToStringLiteral(node.arguments[0], filepath);
  if (!isUtf8Options(node.arguments[1])) {
    throw new AstError('only utf8 readFileSync is supported', node.arguments[1]);
  }

  let readContent = await fs.promises.readFile(constructedPath, 'utf8');

  // Minify inlined javascript.
  if (constructedPath.endsWith('.js')) {
    const result = await terser.minify({[constructedPath]: readContent}, {ecma: 2019});
    if (result.code) {
      readContent = result.code;
    }
  }

  // Escape quotes, new lines, etc so inlined string doesn't break host file.
  return JSON.stringify(readContent);
}
Attempts to statically determine the target of a `fs.readFileSync()` call and
returns the already-quoted contents of the file to be loaded.
If it's a JS file, it's minified before inlining.
@param {SimpleCallExpression} node ESTree node for `fs.readFileSync` call.
@param {string} filepath The path of the file containing this node.
@return {Promise<string>}