Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange default directory behavior #237

Closed
rococode opened this issue Dec 28, 2017 · 1 comment
Closed

Strange default directory behavior #237

rococode opened this issue Dec 28, 2017 · 1 comment
Labels
Milestone

Comments

@rococode
Copy link

I'm literally just using new HardSourceWebpackPlugin(); so I don't think I'm doing anything wrong, but this is what's being generated by the plugin right now:

As you can see, it's creating a brand new node_modules inside my src folder, rather than using my actual node_modules folder (which is one level up).

Is this meant to be the default behavior with this folder structure? Seems kind of unusual.

@mzgoddard
Copy link
Owner

@rococode The default creates a cache directory relative to your webpack context option. If thats not set it makes the path relative to the current working directory.

So either your context points into src, or you're building from that directory. I think thats fine and hard-source should probably be a little smarter. But I'm not sure if I'll make that change in 0.5.x, so that may be a bit before the default changes in probably 0.6.x.

You can work around this by setting cacheDirectory in the options to HardSource.

Thanks for opening this issue.

@mzgoddard mzgoddard added the soon label May 21, 2018
@mzgoddard mzgoddard added this to the 0.8 milestone May 22, 2018
mzgoddard added a commit that referenced this issue May 28, 2018
* fix: use find-cache-dir for default cache directory (#237)

* fix: find root environment hash directory with pkg-dir

* fixup! fix: use find-cache-dir for default cache directory (#237)

* fixup! fix: find root environment hash directory with pkg-dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants