Import in Javascript


I have seen several imports here:

If I try to search for documentation about how that may be made all the results I get are of the kind: "there is no import in Javascript". Example: How do I include a JavaScript file in another JavaScript file?

I am guessing it is a node.js thing, but I've seen require used and not import, so this may be a different framework or tool.

How is this possible? It looks quite cool. Thank you.

Problem courtesy of: Trylks


D3 is indeed using NodeJS running a dev package named Smash that converts those import into concatenated files.

Solution courtesy of: elclanrs


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.