Skip to content

Including third party libraries (like lodash) for Ionic 2 using TypeScript setup #4986

@NathanWalker

Description

@NathanWalker

I'm curious how to include third party libraries like lodash using the TypeScript setup. I see it's included as a dependency in package.json but I can't seem to use it...
I tried:

var _ = require('lodash');

in a component file but of course that gets a Cannot resolve module...

With SystemJS, I'd need something like this:

System.config({
  "map": {
    "lodash": "npm:lodash@3.8.0"
  }
});

But with the webpack setup, I'm not entirely sure.
This would apply to numerous other third party libraries that users may want to use. What's the best way forward on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions