Home

outDir

outDir is a TypeScript compiler option that specifies the directory where emitted JavaScript files are written when TypeScript sources are compiled. It is configured in a tsconfig.json file under the compilerOptions section and directs the compiler to place all output files in a single, designated folder.

When outDir is used, the emitted JavaScript files preserve the folder structure of the input files relative

outDir is commonly used to separate source code from build artifacts, enabling clean project organization and

Note that if you use outFile to concatenate multiple inputs into a single file (for module targets

See also: rootDir, outFile, tsconfig.json, compilerOptions.

to
a
root
directory.
The
rootDir
option
can
influence
this
mapping
by
identifying
the
root
of
the
input
file
hierarchy;
if
rootDir
is
not
set,
the
emitted
structure
mirrors
the
location
of
the
input
files.
For
example,
with
rootDir
set
to
"./src"
and
outDir
set
to
"./dist",
a
source
file
at
src/app/main.ts
will
compile
to
dist/app/main.js.
easier
deployment.
It
also
works
in
conjunction
with
other
options
such
as
sourceMap,
which
will
typically
emit
source
maps
alongside
the
corresponding
JavaScript
files
in
the
same
output
directory.
that
support
concatenation),
the
outDir
setting
is
not
used
for
output.
In
that
scenario,
all
output
is
written
to
the
specified
outFile
path
rather
than
into
a
directory.