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

Webpack IgnorePlugin setting #102

Open
darrenklein opened this issue Nov 25, 2019 · 0 comments
Open

Webpack IgnorePlugin setting #102

darrenklein opened this issue Nov 25, 2019 · 0 comments

Comments

@darrenklein
Copy link

Hello, thank you so much for all of your hard work on this amazing module! I just wanted to report a possible issue in your README documentation, regarding setting the Webpack IgnorePlugin.

The documentation shows that it should be added like so:

"plugins": [
    new webpack.IgnorePlugin(/(fs|child_process)/)
]

but when I did this, I found that it caused other problems with my app. Specifically, I was getting errors in the browser console like:

Uncaught Error: Cannot find module "./offset"

(that's related to a different Node module in my project, it has nothing directly to do with this module)

After a good deal of experimenting, I found that I was able to resolve this issue by providing slightly different formatting for the `IgnorePlugin:

"plugins": [
    new Webpack.IgnorePlugin(new RegExp("^(fs|child_process)$"))
]

and then all worked well - fs and child_process were handled correctly, and no errors with any of my other modules.

In my case, I'm using a rather old version of Webpack, version 3.11.0 - I'm not sure offhand how much a role that may be playing, but wanted to document this here to get your thoughts and possibly help others striking the same issue.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant