Reputation: 3770
I would like to import d3 from unpkg.com but I am not sure which file I should be importing. What would be the unpkg equivalent of:
import * as d3 from "d3";
Upvotes: 1
Views: 904
Reputation: 1096
This will import d3 globally:
import 'https://unpkg.com/[email protected]';
// D3 defined globally
d3.select(...);
This will import it as a module (but make a lot of network requests for each module :/)
import * as d3 from 'https://unpkg.com/[email protected]?module';
Src: https://twitter.com/unpkg/status/905239560988221440
Upvotes: 1