-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How to configure build to not use node modules #3540
Comments
“Not use node modules” could mean many things, and esbuild has many ways of altering things. You’d have to be more specific for me to answer your question. A good start would be to follow the issue reporting instructions that you deleted when posting this issue:
In addition, here are some documentation links you may find helpful: |
@evanw thanks for your answer. esbuild src/index.js --outdir=public/static --bundle --sourcemap --servedir=public --loader:.js=jsx --external:https --external:http --external:zlib --external:url However the error now pops up in another library (geotiff.js) "Uncaught Error: Dynamic require of "http" is not supported". It seems that this library is acting as it is in a node environment and not in a browser. Since geotiff has the "browser:{http: false}" in the package.json, I'm wondering if this error could be due to esbuild or not. Thanks |
The "exports": {
".": {
"import": "./dist-module/geotiff.js",
"require": "./dist-node/geotiff.js",
"browser": "./dist-browser/geotiff.js"
}
}, That looks like a problem with that package to me. The This is a problem with that package, not with esbuild. The right issue to track that problem might be geotiffjs/geotiff.js#396. |
I'm closing this issue because this is a problem in another package. |
Dears,
I'm trying to bundle an app that includes a library which imports http, https, zlib and url from node.
In my previous setup (react-app-rewired) I used to have an override file with this configuration
module.exports = function override(config, env){
config.resolve.fallback = {
http: false,
https: false,
zlib: false,
url: false
}}
I've been experimenting quite a lot but can't figure out how to do it with ESBuild.
Would you have any hints?
The text was updated successfully, but these errors were encountered: