tleunen / eslint-import-resolver-babel-module

Custom eslint resolve for babel-plugin-module-resolver
https://github.com/tleunen/babel-plugin-module-resolver
MIT License
248 stars 31 forks source link

Run compile when installing from github #84

Open mgtitimoli opened 6 years ago

mgtitimoli commented 6 years ago

Hi there,

Before moving forward I want to thank you for all your work, I have been using the package for a long time and it's amazing, thanks!

I opened the issue since I've installed latest babel, and I noticed that the version that started using babel had not yet been published (is there a chance you can publish it?), so I pointed the package to be obtained from github/master, and I got an error that it can't load the module.

After digging a bit, I found that the problem was that package.main points to a file that's created on npm.prepare (npm run compile), and since I was getting it from the repo and not from npm, that script didn't run and therefore the main file was missing.

In order to solve the issue and be able to use the package also directly from github, instead of using npm.prepare hook, npm.prepack should be used.

I believe doing this change will do no harm and allow testing the package before it gets published.

What do you think?