Skip to content

Latest commit

 

History

History
124 lines (91 loc) · 2.63 KB

File metadata and controls

124 lines (91 loc) · 2.63 KB
cwd runme
nestjs
id version
01HJS4EAEA9N1QEW6CD88S03R4
v2.2

npm install vs pnpm install vs bun install

npm

rm -rf node_modules
npm install --offline

pnpm

rm -rf node_modules
pnpm install --prefer-offline

bun

rm -rf node_modules
bun install --offline

Node.Js VS Bun Runtime

npx [email protected] -f cat2 "Hallo, FrankenJs!"
bunx [email protected] -f cat2 "Hallo, FrankenJs!"

vite vs esbuild vs bun build

vite build

time pnpm build

Esbuild

npx --offline [email protected] src/main.ts \
    --bundle --platform=node --minify --outfile=dist/esbuild-nestjs \
    --external:class-transformer \
    --external:class-validator \
    --external:@nestjs/microservices \
    --external:@nestjs/websockets/socket-module

du -bh dist/esbuild-nestjs

Bun Build

time bun build src/main.ts \
    --target node --minify --outfile=dist/bun-nestjs \
    --external class-transformer \
    --external class-validator \
    --external @nestjs/microservices \
    --external @nestjs/websockets/socket-module
du -bh dist/bun-nestjs

Bun Build - Single Binary

time bun build src/main.ts \
    --compile --minify --outfile=dist/bun-sf-nestjs \
    --external class-transformer \
    --external class-validator \
    --external @nestjs/microservices \
    --external @nestjs/websockets/socket-module
du -bh dist/bun-sf-nestjs

Bun Makro Support

cat ../bun-examples/makroLib.ts
cat ../bun-examples/makro.ts
bun build ../bun-examples/makro.ts

Bun test

Nestjs example

cat src/app.controller.spec.ts

Jest

pnpm exec jest src/app.controller.spec.ts

Bun

bun test src/app.controller.spec.ts