Open mariusrak opened 11 months ago
So I went into code and changed the hook before-existing-directory
to existing-directory
and it works. Seems like on mac for some reason a directory is only considered existing if there also exists the package.json
file. So can we change the hook?
Sorry, after a day of debugging I found out it's not about mac or windows. It's just that on windows I have mistakenly some package.json
somewhere in disk root. So after I created a package.json
for project, it works. However, I don't need this package.json
in the root (I have somewhat special project structure).
But I think, that this functionality should not depend on some random package.json
, that doesn't belong to the directory that has named index instead of real index.js
. So would it be possible to tap it on some other hook?
package.json
is significant for a nodejs project. The behaviour of some tools are different whether it exists or not. I'm not sure about your project structure and the configurations. What version of Webpack are you using? Are you able to provide some more info about your setup?
I don't know if we can just tap into a different hook. Need to be careful as changing that could break some project unknowingly. If you are certain that tapping to existing-directory
instead solves the problem; then I can make the hook
configurable via a new option. You can then override the hook in your configuration.
Hi, yes, of course package.json is important file, but it's non-existence doesn't mean, that directory doesn't exists.
I tried to copy the plugin code and tap it to some other hook (I guess it was directory
), but that didn't work. I'm not sure if there was some other issue. So I'm not sure which hook we should use. I guess you have more experience in this.
But making it configurable would be great.
Have released a new version 4.1.0
, the hook can be configured via option resolverHook
.
I used this package on Windows and everything works fine.
But when I use it on mac there is a problem. Folders that does not have package.json causes errors and they behave as if they didn't exists. But on windows it doesn't happen.
When I change
/Main/Main.js
to/Main/index.js
. Or with/Main/Main.js
I createpackage.json
, everything works.Could this be fixed by the plugin? Thanks