You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the problem is that in the bundle file i see things like :
import express3 from "express";
import express from "express";
import express2 from "express";
this is really strange to me because I expected to see only one express import in the whole bundle file but it turns out there's one for each usage in different files. for example in my server.ts:
import express from "express";
const app = express();
or in my routers :
import express from "express";
const router = express.Router();
is there a problem with the build script or it's esbuild normal behavior ? because I think removing duplicate codes is one of the main thing a module bundler is supposed to do.
(even adding --minify doesn't fix the issue)
The text was updated successfully, but these errors were encountered:
I'm currently working on a backend project and I'm using nodejs and express and esbuild to bundle my code. here's my build script :
"build": "esbuild src/server.ts --bundle --platform=node --outfile=dist/bundle.js --format=esm --packages=external",
the problem is that in the bundle file i see things like :
this is really strange to me because I expected to see only one express import in the whole bundle file but it turns out there's one for each usage in different files. for example in my server.ts:
or in my routers :
is there a problem with the build script or it's esbuild normal behavior ? because I think removing duplicate codes is one of the main thing a module bundler is supposed to do.
(even adding --minify doesn't fix the issue)
The text was updated successfully, but these errors were encountered: