Importing the default module from es2015 into old code

2015-11-19
Sigurd Gartmann

Javascript es2015 has nice import and export statements. But if you need to import the “default” module from a file using es2015 into an older file not using it, you need to append “.default” in the require statement.

var somethingNew = require("./newModule").default