How to import with ECMAScript (vanilla javascript) with modules es6

Viewed 1421

I read this post and i want use D3.js (v4+) using only import statement like this:

import { selection } from '../node modules/d3/build/d3.js';

But, because code output is UMD (or read this) and can't import because some globals is no defined, and ES6 can't resolve absolutive names in node_modules for example and vanilla don't suport import statement without extension like this:

import * as someFeature from './myAwesomeModule';

And this is pattern to import modules and each day is growing up like you see here.

How i can use import statement without any plugin today?

1 Answers
Related