Import CommonJS modules without default export via ES6

Posted on

Without default

import * as foo from "foo";

var foo = require("foo");

With default

import foo from "foo";

var foo = require("foo").default;

Complete conversion here: https://github.com/sebmck/6to5/blob/master/MODULES.md#common-default

Leave a Reply

Your email address will not be published.