tern
tern copied to clipboard
Ensure webpack.js resolves before modules.js
I had a webpack configuration where modules.js was resolving node_modules/foo when I wanted my webpack.config.js to be resolved instead.
In order to enforce the correct order, I changed the resolve addition to unshift instead of push to the array. This ensures webpack resolves before modules.
Hi, modules.js uses registered resolvers first. If nothing found by any registered resolvers. It will then use the default resolver to try again (ref).
Maybe you use node_resolve plugin too.
And it resolves node_modules/foo.
Can you confirm the order of plugins in the .tern-project is as expected?
Oh, I just realize the config of plugins are object. I think a better solution is try to allow the plugin config have order.
@othree, I originally wanted to allow the plugin config have the order. I can't find the code block I made, but somehow, I decided to switch to this current implementation because the original implementation made no sense to me.
I'm not very happy working on this project. I basically decided to fork the project and go my own way. I'm still willing to collaborate, but I have been feeling ignored for too long. @ See #927
Sorry to let you feel bad. I am in a rush time recently(home, work, family).
I think to change the order is a breaking change. Might cause other user have issue working on tern + webpack. So I need take some time to see how people use webpack (I didnt use it for my job and project.) And I think the worst case is to add a new configure option if this order make any sense.
I've been using this change for over a year now and it works great