generate-bundle.js 588 B

123456789101112131415161718192021
  1. const child_process = require('child_process');
  2. const fs = require('fs');
  3. const path = require('path');
  4. child_process.execSync('npm run build');
  5. const prefix = path.join('..', 'dist');
  6. const json_string = fs.readFileSync(path.join(prefix, 'manifest.json'));
  7. const manifest = JSON.parse(json_string);
  8. const ios_filename = manifest['ios.js'];
  9. fs.writeFileSync(
  10. 'send-ios/assets/ios.js',
  11. fs.readFileSync(`${prefix}${ios_filename}`)
  12. );
  13. const vendor_filename = manifest['vendor.js'];
  14. fs.writeFileSync(
  15. 'send-ios/assets/vendor.js',
  16. fs.readFileSync(`${prefix}${vendor_filename}`)
  17. );