How to use the rollup.rollup function in rollup

To help you get started, we’ve selected a few rollup 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 axa-ch / patterns-library / stack / tasks / bundles / polyfill.js View on Github external
async function buildPolyfills() {
  const bundle = await rollup.rollup(common.inputOptions);
  const file = common.adaptSlashes(`${CWD}/${ENV === constants.ENV.PROD ? 'dist' : '.tmp'}/app/es6-polyfills.js`);
  // console.log(`Styleguide Bundel: ${file}`); // eslint-disable-line
  // or write the bundle to disk
  await bundle.write({
    ...common.outputOptions,
    file,
  });
}
github ionic-team / stencil / scripts / build.components.js View on Github external
var rollup = require( 'rollup' );
var fs = require('fs');
var path = require('path');
var ncp = require('ncp').ncp;


var es2015Entry = path.join(__dirname, '../node_modules/ionic-ui/es2015/index.js');
var es2015Dest = es2015Entry;

var npmPackageJsonSource = path.join(__dirname, './npm.package.json');
var npmPackageJsonDest = path.join(path.dirname(es2015Dest), '../package.json');
var npmPackageJsonContent = fs.readFileSync(npmPackageJsonSource).toString();
fs.writeFileSync(npmPackageJsonDest, npmPackageJsonContent);


rollup.rollup({
  entry: es2015Entry

}).then(function (bundle) {
  // Generate bundle + sourcemap
  var result = bundle.generate({
    format: 'es'
  });

  fs.writeFileSync(es2015Dest, result.code);

  var source = path.dirname(es2015Entry, '..');

  deepCopy(source, path.join(__dirname, '../demos/angular/node_modules/ionic-ui'));
});
github ionic-team / stencil / scripts / build-dev-server.js View on Github external
async function bundleDevServer() {
  const rollupBuild = await rollup.rollup({
    input: ENTRY_FILE,
    external: [
      'buffer',
      'child_process',
      'crypto',
      'events',
      'fs',
      'http',
      'https',
      'net',
      'os',
      'path',
      'querystring',
      'url',
      'zlib',
    ],
github seleb / bitsy-hacks / build.js View on Github external
readme.plugin(),
			headerComment(),
			topLevelOptions(),
			eslint({})
		]
	};

	const outputOptions = {
		file: `${outputDir}${src}.js`,
		format: "iife",
		globals: {
			bitsy: 'window'
		}
	};

	return rollup.rollup(inputOptions)
	.then(bundle => {
		return bundle.write(outputOptions);
	});
}
github onekiloparsec / AA.js / build / build.js View on Github external
function rollupBundle ({ env }) {
  return rollup({
    entry: 'src/index.js',
    plugins: [
      node({
        extensions: ['.js', '.jsx']
      }),
      cjs(),
      jsx({ factory: 'h' }),
      replace(Object.assign({
        __VERSION__: version
      }, env)),
      buble({
        objectAssign: 'Object.assign'
      })
    ]
  })
}
github jkuri / angular-rollup-starter / scripts / lib / build.ts View on Github external
get prodBuilder(): Observable {
    return Observable.fromPromise(rollup.rollup({
      entry: path.resolve(__dirname, '../../aot/src/main.aot.js'),
      context: 'this',
      plugins: [
        angular({
          preprocessors: {
            style: (scss: string, path: string) => {
              return sass.renderSync({ file: path, outputStyle: 'compressed' }).css;
            }
          }
        }),
        commonjs(),
        nodeResolve(),
        progress()
      ]
    }));
  };
github weexteam / vue-render-for-apache-weex / build / build.js View on Github external
return new Promise((resolve, reject) => {
    rollup.rollup(config).then(bundle => {
      bundle.write(config.output).then(() => {
        report(config.output.file)
        resolve()
      })
    })
  })
}
github lingui / js-lingui / scripts / build / rollup.js View on Github external
}
  const [mainOutputPath, ...otherOutputPaths] = Packaging.getBundleOutputPaths(
    "UNIVERSAL",
    filename,
    packageName
  )
  const rollupOutputOptions = getRollupOutputOptions(
    mainOutputPath,
    format,
    peerGlobals,
    bundle.global
  )

  const spinner = ora(logKey).start()
  try {
    const result = await rollup(rollupConfig)
    await result.write(rollupOutputOptions)
  } catch (error) {
    spinner.fail()
    handleRollupError(error)
    throw error
  }
  for (let i = 0; i < otherOutputPaths.length; i++) {
    await asyncCopyTo(mainOutputPath, otherOutputPaths[i])
  }
  spinner.succeed()
}
github bleenco / ng2-datepicker / scripts / lib / build.ts View on Github external
devMainBuilder(tempDir: string): Observable {
    return Observable.fromPromise(rollup.rollup({
      entry: path.resolve(__dirname, '../../src/main.ts'),
      cache: this.cache,
      context: 'this',
      plugins: [
        angular({
          preprocessors: {
            style: (scss: string, path: string) => {
              return sass.renderSync({ file: path, outputStyle: 'compressed' }).css;
            }
          }
        }),
        tsr({
          typescript: require('../../node_modules/typescript')
        }),
        commonjs(),
        nodeResolve({ jsnext: true, main: true, browser: true }),
github nativescript-vue / nativescript-vue / build / build.js View on Github external
function buildEntry(config) {
  const output = config.output
  const { file } = output

  return rollup.rollup(config)
    .then(bundle => bundle.generate(output))
    .then((res) => {
      return write(file, res.output[0].code)
    })
}