Skip to content

How to import a path with npm specifiers? #17004

Answered by bartlomieju
outloudvi asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to use import map like so:

{
    "imports": {
       "lodash/": "npm:/[email protected]"
    }
}
import uniq from "lodash/uniq";

This was fixed in #16754, notice the slash after npm: - it's required in import maps to map to a folder.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@Conaclos
Comment options

@bartlomieju
Comment options

@bartlomieju
Comment options

@Conaclos
Comment options

@bartlomieju
Comment options

Answer selected by outloudvi
Comment options

You must be logged in to vote
1 reply
@outloudvi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants