Compiler options
emitGitIgnore
If emitGitIgnore
is set to true
a .gitignore
file will be emitted in the output directory. Defaults to true
.
- outdir/
- messages/
+ - .gitignore
- messages.js
- runtime.js
emitPrettierIgnore
If emitPrettierIgnore
is set to true
a .prettierignore
file will be emitted in the output directory. Defaults to true
.
- outdir/
- messages/
+ - .prettierignore
- messages.js
- runtime.js
outputStructure
The outputStructure
defines how modules are structured in the output.
message-modules
- Each module is a message. This is the default.locale-modules
- Each module is a language.
message-modules
Messages have their own module which eases tree-shaking for bundlers.
- outdir/
- messages/
+ - blue_elephant_tree/
+ - index.js
+ - en.js
+ - fr.js
+ - sky_phone_bottle/
+ - index.js
+ - en.js
+ - fr.js
- ...
- messages.js
- runtime.js
locale-modules
Messages are bundled in a per locale module. Bundlers sometimes struggle tree-shaking this structure.
- outdir/
- messages/
+ - de.js
+ - en.js
+ - fr.js
- ...
- messages.js
- runtime.js
experimentalEmitTs
Emits TypeScript files instead of JSDoc annotated JavaScript files. Defaults to false
.
- outdir/
- - messages.js
+ - messages.ts
- - runtime.js
+ - runtime.ts
...
experimentalUseTsImports
Imports emitted files with .ts
extension instead of .js
. Defaults to false
.
Only works in combination with experimentalEmitTs
. The feature is useful in some
codebases which need to resolve TypeScript files with a .ts
ending. Node's
strip-types flag is an example.
-import { getLocale } from "./runtime.js";
+import { getLocale } from "./runtime.ts";