How to set up rollup.js with a d3 plugin?
问题 I currently write a d3 plugin. However, I want to call this plugin as property of the global d3 as in the original example: d3.foo() But when I do this, my configurations for rollup lead to a clash of the d3 references. Here is one minimal example (with just one file) to illustrate: I downloaded the original example of the d3 plugin and slightly changed the source file foo.js: //.src/foo.js import * as d3 from "d3"; export default function() { return d3.select("body").append("div").text(42);