Closed
Description
TypeScript Version: nightly (2.1.0-dev.20161017)
I wanted to use lodash method categories. Here is the code I wrote:
import assign from "lodash/assign";
var myVar = assign({}, {foo:"foo"}, {bar:"bar"});
Expected compiled result:
"use strict"
const assign_1 = require("lodash/assign");
var myVar = assign_1({}, {foo:"foo"}, {bar:"bar"});
Actual compiled result:
"use strict"
const assign_1 = require("lodash/assign");
var myVar = assign_1.default({}, {foo:"foo"}, {bar:"bar"});
Some notes:
- I am using @types/lodash and the definition of assign is:
declare module "lodash/assign" {
const assign: typeof _.assign;
export = assign;
}
- I found out if I remove allowSyntheticDefaultImports and change
import * as assign from "lodash/assign";
, it will work.