ES6 javascript import external js file

后端 未结 1 1637
攒了一身酷
攒了一身酷 2021-01-07 12:57

I\'m trying this in my ES6 javascript module:

import externalutil from \'https://externalutil.com/js/externalutil.js\';

but it fails with

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-07 13:22

    You cannot import URL's (as of yet). You should download the file, put it somewhere locally and reference it locally as well.

    However in your case, I'd just use a

提交回复
热议问题