How to use the rollup/dist/rollup.browser.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 datavis-tech / vizhub-legacy / packages / presenters / src / bundle.js View on Github external
plugins: [
      hypothetical({
        files: transformFilesToObject(files)
      }),
      buble({
        // Disable most ES6 transforms,
        // use Buble mainly for its JSX transform.
        target: {
          chrome: 71
        }
      })
    ],
    external: d3Packages.concat('react')
  };

  const rollupBundle = await rollup(inputOptions);
  const { code, map } = await rollupBundle.generate(outputOptions);

  // Monkey patch magic-string internals
  // to support characters outside of the Latin1 range, e.g. Cyrillic.
  //
  // Related reading:
  //  - https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa#Unicode_strings
  //  - https://github.com/Rich-Harris/magic-string/blob/3466b0230dddc95eb378ed3e0d199e36fbd1f572/src/SourceMap.js#L3
  const toString = map.toString.bind(map);
  map.toString = () => unescape(encodeURIComponent(toString()));

  // Inspired by https://github.com/rollup/rollup/issues/121
  const codeWithSourceMap = code + '\n//# sourceMappingURL=' + map.toUrl();

  return [{
    name: 'bundle.js',