How to use the rollup/dist/loadConfigFile 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 jitsucom / jitsu / javascript-sdk / __tests__ / common / devserver.ts View on Github external
(async function() {
  process.env.NODE_ENV = 'development';

  let rollupFile = `${__dirname}/../../rollup.config.js`;
  console.log(`Loading rollup file ${rollupFile}`);
  const { options, warnings } = await loadConfigFile(path.resolve(rollupFile), { format: 'es' });

  // This prints all deferred warnings
  warnings.flush();

  for (const optionsObj of options) {
    const bundle = await rollup.rollup(optionsObj);
    await Promise.all(optionsObj.output.map(bundle.write));
  }

  // You can also pass this directly to "rollup.watch"
  const watcher = rollup.watch(options);

  watcher.on('event', (event) => {
    if (event.code === 'START') {
      console.log('Building output bundles...')
    } else if (event.code === 'END') {