1. #!/usr/bin/env node
    
  2. 
    
  3. 'use strict';
    
  4. 
    
  5. const chalk = require('chalk');
    
  6. const {execSync} = require('child_process');
    
  7. const {join} = require('path');
    
  8. const {argv} = require('yargs');
    
  9. 
    
  10. const build = require('../build');
    
  11. 
    
  12. const main = async () => {
    
  13.   const {crx} = argv;
    
  14. 
    
  15.   await build('edge');
    
  16. 
    
  17.   const cwd = join(__dirname, 'build');
    
  18.   if (crx) {
    
  19.     const crxPath = join(__dirname, '..', 'node_modules', '.bin', 'crx');
    
  20. 
    
  21.     execSync(`${crxPath} pack ./unpacked -o ReactDevTools.crx`, {
    
  22.       cwd,
    
  23.     });
    
  24.   }
    
  25. 
    
  26.   console.log(chalk.green('\nThe Microsoft Edge extension has been built!'));
    
  27. 
    
  28.   console.log(chalk.green('\nTo load this extension:'));
    
  29.   console.log(chalk.yellow('Navigate to edge://extensions/'));
    
  30.   console.log(chalk.yellow('Enable "Developer mode"'));
    
  31.   console.log(chalk.yellow('Click "LOAD UNPACKED"'));
    
  32.   console.log(chalk.yellow('Select extension folder - ' + cwd + '\\unpacked'));
    
  33. 
    
  34.   console.log(chalk.green('\nYou can test this build by running:'));
    
  35.   console.log(chalk.gray('\n# From the react-devtools root directory:'));
    
  36.   console.log('yarn run test:edge\n');
    
  37. };
    
  38. 
    
  39. main();