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.
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
esbuild. --outdir=./dist --platform=node
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.