importing d3.event into a custom build using rollup : <p>I've got a file <code>d3.custom.build.js</code> like this (simplified):</p>

<pre><code>import { range } from 'd3-array';
import { select, selectAll, event } from 'd3-selection';
import { transition } from 'd3-transition';

export default {
    range,
    select,
    selectAll,
    event,
    transition
};
</code></pre>

<p>And a <code>rollup.config.js</code> like this:</p>

<pre><code>import nodeResolve from 'rollup-plugin-node-resolve';

export default {
    entry: './js/vendor/d3-custom-build.js',
    dest: './js/vendor/d3-custom-built.js',
    format: 'iife',
    globals: {
        d3: 'd3'
    },
    moduleId: 'd3',
    moduleName: 'd3',
    plugins: [nodeResolve({ jsnext: true })]
};
</code></pre>

<p>I want to export to a plain old browser global named 'd3'. I'm calling rollup from a simple npm script. The good news is that almost everything works in the output file, except for one thing: <code>d3.event</code> in browser is always null. No, it's not an issue with events being hijacked on the page. When I swap in the standard full d3 4.0 library into the script tag everything works fine. It's definitely a build issue.</p>

<p>The <a href="https://github.com/d3/d3-selection/blob/master/README.md#customEvent" rel="noreferrer">d3 docs</a> warn that bundling <code>event</code> is tricky:</p>

<blockquote>
  <p>If you use Babel, Webpack, or another ES6-to-ES5 bundler, be aware
  that the value of d3.event changes during an event! An import of
  d3.event must be a live binding, so you may need to configure the
  bundler to import from D3’s ES6 modules rather than from the generated
  UMD bundle; not all bundlers observe jsnext:main. Also beware of
  conflicts with the window.event global.</p>
</blockquote>

<p>It appears that setting <code>nodeResolve({ jsnext: true })</code> isn't sufficing. How do I get a live binding in the bundle? Any guidance very appreciated.</p>
