VSCode Vetur Intellisense Not working properly for template register without .vue extension file name

603 Views Asked by At

My orders.js file contains this line:

Vue.component("prefix-orders", require("./Orders").default);

My template file name is: Orders.vue

I'm using Laravel 8 at the same time for that project. But I dont't have any config file for. Vue or Vetur. Maybe I should create a config file for exploring .vue files for non-extension template registrations.

When I try to "Go to definition" right click on "./Orders" It pops up an error:

Unable to open 'Orders': Unable to read file '/var/www/html/xxx/Modules/Orders/src/Resources/assets/js/Orders' (Error: Unable to resolve nonexistent file '/var/www/html/xxx/Modules/Orders/src/Resources/assets/js/Orders').

When I change to require("./Orders") to require("./Orders.vue") it works. But my project has got so many files registered without .vue extension. I don't want to change my colleagues' coding standard. They use phpstorm and it works on it. But I want to switch VSCode.

Please help to use "Go to Definition" for require without .vue extension

0

There are 0 best solutions below