How to use in-publish - 10 common examples

To help you get started, we’ve selected a few in-publish 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 pshrmn / curi / packages / curi-middleware-query / scripts / build.js View on Github external
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)
  });
github mjackson / http-client / scripts / build.js View on Github external
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'))
github gribnoysup / react-yandex-maps / tools / build.js View on Github external
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'
github mjackson / value-equal / tools / build.js View on Github external
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'
github mjackson / resolve-pathname / tools / build.js View on Github external
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'
github ReactTraining / react-history / scripts / build.js View on Github external
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)
github mjackson / value-equal / scripts / build.js View on Github external
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)
github carbon-design-system / carbon-addons-data-viz-react / scripts / build.js View on Github external
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),
github mjackson / expect / scripts / build.js View on Github external
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)
github mjackson / react-style / scripts / build.js View on Github external
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)

in-publish

Detect if we were run as a result of `npm publish`

ISC
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis

Popular in-publish functions