Closed wszgrcy closed 1 week ago
Please read the “getting started” instructions in the documentation: https://esbuild.github.io/getting-started/#bundling-for-node:
You also may not want to bundle your dependencies with esbuild. There are many node-specific features that esbuild doesn't support while bundling such as
__dirname
,import.meta.url
,fs.readFileSync
, and*.node
native binary modules. You can exclude all of your dependencies from the bundle by setting packages to external:esbuild app.jsx --bundle --platform=node --packages=external
Please read the “getting started” instructions in the documentation: https://esbuild.github.io/getting-started/#bundling-for-node:
You also may not want to bundle your dependencies with esbuild. There are many node-specific features that esbuild doesn't support while bundling such as
__dirname
,import.meta.url
,fs.readFileSync
, and*.node
native binary modules. You can exclude all of your dependencies from the bundle by setting packages to external:esbuild app.jsx --bundle --platform=node --packages=external
Can 'dynamic require' be supported in 'onResolve' to allow users to set their own parsing method?
The sharp
package is not compatible with bundlers. You should use --packages=external
so you don't bundle the sharp
package. You don't need to use onResolve
to solve this problem.
The
sharp
package is not compatible with bundlers. You should use--packages=external
so you don't bundle thesharp
package. You don't need to useonResolve
to solve this problem.
thanks
like
sharp
package. I use configwhen I import (Imported by other packages),after build ,The file
sharp-linux-x64-DQNVFNDI.node
has been successfully extracted insharp
packagebut
module2.exports
return a path string../sharp-linux-x64-DQNVFNDI.node
I try to use https://github.com/evanw/esbuild/issues/1051#issuecomment-806325487 but not work Is it because 'require' was not captured in the ESM?