Haehnchen/idea-php-symfony2-plugin

[AssetMapper] Scoped npm packages (e.g. @hotwired/turbo) not resolved

adeys opened this issue · 6 comments

adeys commented

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.

Packages unresolved

This is resolved when I copy assets/vendor/@hotwired/stimulus/stimulus.index.js to assets/vendor/@hotwired/stimulus.js
Packages resolved

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

adeys commented

Proposed fix : #2275

What about typescript?

adeys commented

Hey @chapterjason,

Are you talking about stimulus controllers written using typescript ?

adeys commented

@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