Last Updated: February 25, 2016
·
1.189K
· mruzekw

Import CommonJS modules without default export via ES6

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