Skip to content

Importing scoped npm modules without scope name #7695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sasidhar opened this issue Mar 26, 2016 · 2 comments
Closed

Importing scoped npm modules without scope name #7695

sasidhar opened this issue Mar 26, 2016 · 2 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@sasidhar
Copy link

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?

@Arnavion
Copy link
Contributor

See paths tsconfig.json option - #5039 (comment) and #5728

@DanielRosenwasser DanielRosenwasser added the Question An issue which isn't directly actionable in code label Mar 27, 2016
@sasidhar
Copy link
Author

@Arnavion Thanks for the references.
I tried paths with 1.8.9 and found it is not yet out.
Seems it is planned for 1.9.0.

@mhegazy mhegazy closed this as completed Apr 21, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants