How to use the oc-client-browser.getLib function in oc-client-browser

To help you get started, we’ve selected a few oc-client-browser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opencomponents / oc / tasks / build.js View on Github external
const fs = require('fs-extra');
const ocClientBrowser = require('oc-client-browser');
const log = require('./logger');
const path = require('path');
const packageJson = require('../package');

const ocVersion = packageJson.version;
const clientComponentDir = '../src/components/oc-client/';
const ocClientPackageInfo = require(`${clientComponentDir}package.json`);

log['start']('Building client');

fs.emptyDirSync(path.join(__dirname, clientComponentDir, 'src'));

ocClientBrowser.getLib((err, libContent) => {
  if (err) {
    log['error'](err);
  }

  ocClientPackageInfo.version = ocVersion;
  fs.writeJsonSync(
    path.join(__dirname, clientComponentDir, 'package.json'),
    ocClientPackageInfo,
    { spaces: 2 }
  );

  fs.writeFileSync(
    path.join(__dirname, clientComponentDir, 'src/oc-client.min.js'),
    libContent
  );

oc-client-browser

OC browser client

MIT
Latest version published 1 month ago

Package Health Score

70 / 100
Full package analysis

Popular oc-client-browser functions