Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs');
const execSync = require('child_process').execSync;
const inInstall = require('in-publish').inInstall;
const prettyBytes = require('pretty-bytes');
const gzipSize = require('gzip-size');
if (inInstall()) {
process.exit(0);
}
const buildStats = {}
const build = (name, command, extraEnv) => {
const buildStartTime = new Date();
console.log('\nBuilding', name);
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv)
});
const readFileSync = require('fs').readFileSync
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command) =>
execSync(command, { stdio: 'inherit' })
exec('npm run build-lib')
exec('npm run build-umd')
exec('npm run build-min')
console.log(
'\ngzipped, the UMD build is ' + prettyBytes(
gzipSize.sync(readFileSync('umd/http-client.min.js'))
const fs = require('fs-extra')
const path = require('path')
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall()) process.exit(0)
const exec = (command, extraEnv) =>
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv)
})
console.log('Building CommonJS modules ...')
exec('babel src -d main --ignore __tests__', {
BABEL_ENV: 'cjs'
const fs = require('fs')
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, extraEnv) =>
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv)
})
console.log('\nBuilding ES modules ...')
exec('babel modules -d . --ignore __tests__', {
BABEL_ENV: 'es'
const fs = require('fs')
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, extraEnv) =>
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv)
})
console.log('\nBuilding ES modules ...')
exec('babel modules -d . --ignore __tests__', {
BABEL_ENV: 'es'
const readFileSync = require('fs').readFileSync
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, env) =>
execSync(command, { stdio: 'inherit', env })
const webpackEnv = Object.assign({}, process.env, {
NODE_ENV: 'production'
})
exec('npm run build-cjs')
exec('npm run build-umd', webpackEnv)
exec('npm run build-min', webpackEnv)
const readFileSync = require('fs').readFileSync
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, env) =>
execSync(command, { stdio: 'inherit', env })
const webpackEnv = Object.assign({}, process.env, {
NODE_ENV: 'production'
})
exec('npm run build-lib')
exec('npm run build-umd', webpackEnv)
exec('npm run build-min', webpackEnv)
const execSync = require('child_process').execSync;
const inInstall = require('in-publish').inInstall;
const path = require('path');
const rimraf = require('rimraf');
const fs = require('fs-extra');
const globby = require('globby');
const Promise = require('bluebird');
if (inInstall()) process.exit(0);
const babelPath = path.resolve(__dirname, '../node_modules/.bin/babel');
const dirs = ['components'];
const rootDir = path.resolve(__dirname, '../');
const exec = (command, extraEnv) =>
execSync(command, {
stdio: 'inherit',
env: Object.assign({}, process.env, extraEnv),
const readFileSync = require('fs').readFileSync
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, env) =>
execSync(command, { stdio: 'inherit', env })
const webpackEnv = Object.assign({}, process.env, {
NODE_ENV: 'production'
})
exec('npm run build-lib')
exec('npm run build-umd', webpackEnv)
exec('npm run build-min', webpackEnv)
const readFileSync = require('fs').readFileSync
const execSync = require('child_process').execSync
const inInstall = require('in-publish').inInstall
const prettyBytes = require('pretty-bytes')
const gzipSize = require('gzip-size')
if (inInstall())
process.exit(0)
const exec = (command, env) =>
execSync(command, { stdio: 'inherit', env })
const webpackEnv = Object.assign({}, process.env, {
NODE_ENV: 'production'
})
exec('npm run build-lib')
exec('npm run build-umd', webpackEnv)
exec('npm run build-min', webpackEnv)