import-js
import-js copied to clipboard
Lodash alias doesn't work
I'm trying to get ImportJS to automatically import Lodash for me. Here's what my config looks like:
module.exports = {
aliases: {
_: "lodash",
},
danglingCommas: false,
maxLineLength: 100
};
When I run ImportJS on a file containing this:
console.log(_.map([ 1, 2, 3 ], x => x * x));
Nothing seems to happen. What am I missing?
Thanks!
Hi @LandonSchropp! I can confirm this isn't working in my case either. A workaround seems to be if you specify the full path to the lodash module. This works for me:
module.exports = {
aliases: {
_: "node_modules/lodash",
}
};
@trotzig Thanks for the workaround! That seems to get me past the issue. 🙂
Closing this issue as it has become stale. If you feel we should look more into this, please feel free to reopen it. Thanks.