const fs = require('fs');
const path = require('path');
const Module = require('module');

const source = [
  fs.readFileSync(path.join(__dirname, 'xhs_creator_sign_other_part1.js'), 'utf8'),
  fs.readFileSync(path.join(__dirname, 'xhs_creator_sign_other_part2.js'), 'utf8'),
  fs.readFileSync(path.join(__dirname, 'xhs_creator_sign_other_part3.js'), 'utf8'),
  fs.readFileSync(path.join(__dirname, 'xhs_creator_sign_other_part4.js'), 'utf8'),
].join('');

const filename = path.join(__dirname, 'xhs_creator_sign_other.compiled.js');
const child = new Module(filename, module.parent || module);
child.filename = filename;
child.paths = Module._nodeModulePaths(__dirname);
child._compile(source, filename);

module.exports = child.exports;
