const Transformer = require("@parcel/plugin").Transformer;
const path = require("path");

module.exports = new Transformer({
  async transform({ asset, options }) {
    let file = path.join(path.dirname(asset.filePath), "included.txt");
    asset.invalidateOnFileChange(file);
    let content = await options.inputFS.readFile(file, "utf8");
    asset.setCode(content);
    return [asset];
  }
});
