Skip to content

Importing scoped npm modules without scope name #7695

Closed
@sasidhar

Description

@sasidhar

This is a question.

We have some private NPM packages using npmjs' private repository. Assume

  • scope name : @scope
  • private package name as : private-package

When we install this NPM package using
npm install @scope/private-package

It is installed to : ./node_modules/@scope/private-package

In VSCode, to import some thing from this package, we need to do
import {SomeThing} from '@scope/private-package'

Is there anything in TypeScript configuration that we can re-map
@scope/private-package to private-package
so that we can use like
import {SomeThing} from 'private-package' instead of adding@scope?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions