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

support importmap #1365

Closed
4 tasks done
aladdin-add opened this issue May 24, 2022 · 3 comments
Closed
4 tasks done

support importmap #1365

aladdin-add opened this issue May 24, 2022 · 3 comments
Labels

Comments

@aladdin-add
Copy link

aladdin-add commented May 24, 2022

Clear and concise description of the problem

refs: https://nodejs.org/api/packages.html#subpath-imports

I was using

  • node.js v18.1.0
  • vitest v0.12.4

the package.json imports:

{
  "imports": {
    "#@": "./src/"
  },
}
import { actuator } from '#@/actuator.js'

got the err:

 FAIL  __tests__/actuator.spec.ts [ __tests__/actuator.spec.ts ]
Error: [vite-node] Failed to load #@/actuator.js

Suggested solution

just load the module successfully.

Alternative

n/w

Additional context

No response

Validations

@sheremet-va
Copy link
Member

We are using Vite's resolveId function on pluginContainer, so this is more about Vite's support. Please, open an issue in their repository.

@sheremet-va
Copy link
Member

Please, follow this PR in Vite, if you are interested in this feature: vitejs/vite#7770

@sheremet-va
Copy link
Member

Should be supported since vitejs/vite#7770

@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants