How to import Echarts Baidu Map in my plugin?

Echarts is a opensource chart SDK,and has a extend with Baidu map.when i want to use it with baidu map extension in plugin, first i need init baidu map js as ?

i use import as follow:
import api from ‘’;

throw a CORS exception


Can you install it thru npm instead and import the code in your javascript file?