0.0.5 • Published 5 years ago

@bext/manifest-distributor v0.0.5

Weekly downloads
8
License
-
Repository
-
Last release
5 years ago

Manifest Distributor

Example usage:

const path = require('path');

const manifestDistributor = require('./packages/manifest-distributor');

distributeManifest();

async function distributeManifest() {
  try {
    // initialize the distributor
    await manifestDistributor.init();

    // generate specific manifest.json files for each browser
    (await manifestDistributor.from(path.join(__dirname, 'src', 'manifest.json'))).to({
      chrome: {
        destPath: path.join(__dirname, 'dist', 'chrome', 'manifest.json')
      },
      firefox: {
        destPath: path.join(__dirname, 'dist', 'firefox', 'manifest.json')
      },
      edge: {
        destPath: path.join(__dirname, 'dist', 'edge', 'manifest.json')
      }
    });
  } catch (error) {
    console.log(error);
  }
}