[AssetMapper] Scoped npm packages (e.g. @hotwired/turbo) not resolved
adeys opened this issue · 6 comments
Hi @Haehnchen
Thanks for the really great work you're doing on this plugin.
The support for importmap
is also very helpful. But as shown as on the below pictures, scoped npm packages (@hotwired/turbo
, @hotwired/stimulus
) are not fully resolved and the autocomplete is biased.
This is resolved when I copy assets/vendor/@hotwired/stimulus/stimulus.index.js
to assets/vendor/@hotwired/stimulus.js
Digging through the code it should be fixed by checking the specific case of scoped npm packages when a file has slashes. I'll propose a fix PR in the comment.
Thanks
What about typescript?
Hey @chapterjason,
Are you talking about stimulus controllers written using typescript ?
@adeys Yes
@chapterjason It works with typescript controllers too.
The dependencies are resolved by the plugin but you'll have to tweak your tsconfig.json
file to make typescript compiler happy