Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

79
Views
esbuild is not compiling imported modules

I am trying to compile a very simple typescript code with esbuild.

However esbuild is compiling only the entry file.

This is my setup:

//index.ts
import * as mod1 from './mod1';
mod1.my_method();
//mod1.ts
export function my_method(){
  console.log('debug');
}

I run:

esbuild index.ts --outdir=./dist --platform=node

the compilation is done with no error and if I now check the dist I get only

dist
- index.js
// dist/indes.js
import * as mod1 from './mod1';
mod1.my_method();

but there is no trace of dist/mod1.js. So of course the code cannot run and give an error.

Why esbuild is not compiling all the other files like mod1.ts?

I can't use --bundle in my project.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

esbuild index.ts --outdir=./dist --platform=node ^^^

you only specify the index.ts file in the commandline

i never actually worked with esbuild, but there is probably a function for folders, like esbuild . --outdir=./dist --platform=node

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!