Skip to content Skip to sidebar Skip to footer

ES6 Javascript Import External Js File

I'm trying this in my ES6 javascript module: import externalutil from 'https://externalutil.com/js/externalutil.js'; but it fails with this transpile error: Module not found: 'h

Solution 1:

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 <script /> tag to include it in your html and just access the window object. Converting it would be more hassle than it would be beneficial.


Post a Comment for "ES6 Javascript Import External Js File"