Static inline import

import.*("path/to/module") in addition to the existing expression import("path/to/module"), which would be equivalent to:

import * as _i_ae9fa from "path/to/module";

// where the expression appeared...
_i_ae9fa

It's useful for solving name conflicts and contributing static media.

Sounds like

?

1 Like

Yes, surprised it's a recent proposal though X_X

Great idea, garbage syntax

Unfortunately... I could just think of import.sync("path") (initial version of this post) or import.*("path"). The latter is shortened, in comparison. I honestly prefer ECMAScript 4's fully qualified names (net.cartoon.weare.Item), they look much more readable (but then importing media would be different).

I like import.static("path/to/module")

1 Like