Typescript: Support dynamic import modules from CDN

Created on 1 Jun 2018  路  3Comments  路  Source: microsoft/TypeScript

ES dynamic import support import a module from CDN like this:

import('https://abc.com/a.js')

However, TS will report this line as an error: can't find the module.

Is there a plan to support this feature?

Question

Most helpful comment

Hi,
I would also like to do this. But I don't understand how. Could you give a little more insight?
Thanks

All 3 comments

Add an ambient module declaration for it. See https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules for more details.

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

Hi,
I would also like to do this. But I don't understand how. Could you give a little more insight?
Thanks

Was this page helpful?
0 / 5 - 0 ratings