-
Notifications
You must be signed in to change notification settings - Fork 73
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
Make it work in webpack #22
Comments
I am not familiar with Webpack. Jailed checks if |
Hello @asvd , When Webpack does a static analysis to substitute the require statements with real modules, it can't recognize dynamic requires, like here: Line 192 in 1682cdb
This causes the compilation to fail. Generally, with packages that run indifferently on the client and the server side, it's good to give an hint that some modules your package requires are and will always be unavailable on the browser. There's a field in the That's why I suggested to add the |
(I'm already running it with a workaround, by the way - but it would be nice for |
Yep, this is how I understood the webpack works. I just needed you to confirm that after the compilation jailed properly works in web-environment recognizing it on its own (otherwise the proposed workaround would make no sence). Will update the package.json hopely this evening, thanks for the contribution. (optionally you could submit a pull-request ;-)) |
Webpack's static analysis breaks jailed: it's probably because
child_process
is required dynamically.Anyway, would it be possible to follow this to make it work in the browser?
Just adding:
browser: { fs: false, child_process: false }
to thepackage.json
would do the trickThe text was updated successfully, but these errors were encountered: