我想从unpkg.com导入d3,但我不确定应该导入哪个文件。什么是开箱等价物:
import * as d3 from "d3";
这将全局导入d3:
import 'https://unpkg.com/d3@6.2.0';
// D3 defined globally
d3.select(...);
这将把它作为一个模块导入(但会对每个模块发出大量网络请求:/(
import * as d3 from 'https://unpkg.com/d3@6.2.0?module';
Src:https://twitter.com/unpkg/status/905239560988221440