How to prevent webpack from reading a dependency's whole directory? #19675
Unanswered
jsumners-nr
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Can you create reproducible test repo? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am exploring writing a plugin for webpack. As part of that, I'm working in a simple project with two dependencies. One of those dependencies is
npm link
ed, and as a result has a lot of extraneous files that would not be present whennpm install
ing the dependency. When I runnpx webpack
on this simple project, I get:This is due to webpack internally using the spread operator which is susceptible to call stack overflow:
webpack/lib/ContextModuleFactory.js
Lines 425 to 427 in 8ca8b7d
A "fix" for this would be:
But that will just result in the following line trying to append to an array that is already at the maximum array size (
RangeError: Invalid array length
-- see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length):webpack/lib/FileSystemInfo.js
Line 3635 in 8ca8b7d
I believe what is happening is:
package.json
dependencies
block into a cacheHow do I configure webpack, ideally within my plugin, to completely ignore specific directories within the offending dependency's file system?
Beta Was this translation helpful? Give feedback.
All reactions