You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This configuration only scopes the specifier for modules that start with "https://jsr.io/@scope/my-package/0.0.0/". However, if my package at "https://jsr.io/@scope/my-package/0.0.0" imports an another JSR package, which needs the same jsx-runtime, it doesn't remap the "react/jsx-runtime" specifier for that package. I would need to add a separate scope for each dependency, which becomes cumbersome, and even so, I can't add a scope inside a scope.
Is there a way to apply the mapping for "react/jsx-runtime" not only to "@scope/my-package/0.0.0" but also to all its dependencies, without having to explicitly define a scope for each dependency? either from the deno.json, or via an app script ?
The text was updated successfully, but these errors were encountered:
@lucacasonato I know about the imports field thanks.
It doesn’t address my issue though, I was looking for a way to apply a mapping for a file and all it’s nested dependencies in an isolated fashion.
Scopes only works at one depth (relative to one scope), and imports do it for all. I was looking for a a way to « do it for all » solution but starting a certain specific scope.
For example my use case is the following, I would like all files that have a use client directive to import the client version of react, but also all it’s dependencies without explicitly adding every single of them with a scope into the import map, this is because some dependencies are shared so they also can be imported with a different resolution (server or client). More information here: reactjs/rfcs#227
Let me know if that’s not clear and also I understand if that’s not possible at all or isn't a goal for Deno to support this usecase.
Essentially what im trying to do is:
if specifier A imports specifier B, then specifier B imports C
if specifier X imports specifier B, then specifier B imports not C but D.
where in the configuration file I can state that any specifier C down from X is remapped to D.
I would like to know if import maps can scope a specifier for all its dependencies.
Consider the following example:
This configuration only scopes the specifier for modules that start with "https://jsr.io/@scope/my-package/0.0.0/". However, if my package at "https://jsr.io/@scope/my-package/0.0.0" imports an another JSR package, which needs the same jsx-runtime, it doesn't remap the "react/jsx-runtime" specifier for that package. I would need to add a separate scope for each dependency, which becomes cumbersome, and even so, I can't add a scope inside a scope.
Is there a way to apply the mapping for "react/jsx-runtime" not only to "@scope/my-package/0.0.0" but also to all its dependencies, without having to explicitly define a scope for each dependency? either from the deno.json, or via an app script ?
The text was updated successfully, but these errors were encountered: