lighthouse-extension/build-extension.js
/**
 * Put built extension into a zip file ready for install or upload to the
 * webstore.
 * @return {Promise<void>}
 */
Put built extension into a zip file ready for install or upload to the
webstore.
@return {Promise}
Put built extension into a zip file ready for install or upload to the webstore . @return { Promise }
async function packageExtension() {
  await del([
    `${distDir}/scripts/${CONSUMERS.DEVTOOLS.dist}`,
    `${distDir}/scripts/${CONSUMERS.LIGHTRIDER.dist}`,
  ]);
  return new Promise((resolve, reject) => {
    const archive = archiver('zip', {
      zlib: {level: 9},
    });
    const outPath = `package/lighthouse-${manifestVersion}.zip`;
    const writeStream = fs.createWriteStream(outPath);
    writeStream.on('finish', resolve);
    writeStream.on('error', reject);
    archive.pipe(writeStream);
    archive.glob(`${distDir}/**`);
    archive.finalize();
  });
}
async function packageExtension ( ) { await del ( [ ` ${ distDir } ${ CONSUMERS . DEVTOOLS . dist } ` , ` ${ distDir } ${ CONSUMERS . LIGHTRIDER . dist } ` , ] ) ; return new Promise ( ( resolve , reject ) => { const archive = archiver ( 'zip' , { zlib : { level : 9 } , } ) ; const outPath = ` ${ manifestVersion } ` ; const writeStream = fs . createWriteStream ( outPath ) ; writeStream . on ( 'finish' , resolve ) ; writeStream . on ( 'error' , reject ) ; archive . pipe ( writeStream ) ; archive . glob ( ` ${ distDir } ` ) ; archive . finalize ( ) ; } ) ; }
Put built extension into a zip file ready for install or upload to the
 webstore.
Put built extension into a zip file ready for install or upload to the webstore .