Skip to content
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

how this be made to work to import files from current project using relative paths? #13

Open
adrian-gierakowski opened this issue Jan 20, 2024 · 1 comment

Comments

@adrian-gierakowski
Copy link

let's say I have a module in my project at: ./MyModule.ts

I would like to have it auto imported from anywhere within my project using a relative path, for example:

from ./OtherModule.ts as:

import * as MyModule from './MyModule'

and from ./nested/OtherModule.ts as:

import * as MyModule from '../MyModule'

Currently If I configure the plugin with:

        "namespaces": {
          "MyModule": {
            "importPath": "./MyModule"
          }
        }

the imports always use the literal './MyModule' regardless of where I import from

@snatvb
Copy link

snatvb commented Jan 31, 2024

I think you can resolve it easier and don't wait the feature
just add alias to paths: "~/*": "src"

        "namespaces": {
          "MyModule": {
            "importPath": "~/lib/my-module"
          }
        }

I didn't check it, but maybe it will works and helps you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants