Lisan CLI
Configuration
Lisan CLI configuration can be defined with;
- a
.lisanrc
or.lisanrc.json
file in project root folder. - option
--config <path/to/config/file>
.
List of Commands
Usage
Usage: lisan [options]
Commands:
lisan compile Compile translation files into dictionary files
Options:
-c, --config Path to JSON config file [default: ""]
-v, --version Show version number [boolean]
-h, --help Show help [boolean]
For more information, please visit http://lisanjs.com
compile
lisan compile --help
lisan compile
Compile translation files into dictionary files
Main
-i, --inputDir Source directory where translation files are located.[string]
-o, --outputDir Directory where dictionary files will be generated! [string]
-e, --exclude Exclude all json files matching with glob-like file pattern.
[array]
--declaration Generate Typescript declaration files. [boolean]
Compiler Options
--allowNonExistingKeys Allows using non-existing keys in t() and c()
functions. [boolean]
--autoTrimValues Trims the whitespace chars from every Lisan Literal
entry. [boolean]
--sortEntryKeys Sorts dictionary keys by alphabetical order. [boolean]
--module Sorts dictionary keys by alphabetical order.
[string] [choices: "none", "cjs", "esm", "lisan"]
--returnArray Returns literal elements as an array (JSX Compatible).
[boolean]
Development
-w, --watch Enable watching source directory for changes!
[boolean] [default: false]
Options:
-c, --config Path to JSON config file [default: ""]
-v, --version Show version number [boolean]
-h, --help Show help [boolean]
Configuration File
Configuration object must be valid a JSON5 object,
and should be stored in the project root directory
named as .lisanrc
or .lisanrc.json
file.
{
"compile": {
// lisan-compiler options
"module": "lisan", // none, cjs, esm, lisan
"allowNonExistingKeys": false,
"autoTrimValues": true,
"sortEntryKeys": true,
// command options
"target": "es6",
"inputDir": "i18n/translations/",
"exclude": ["**/*skip.json"],
"outputDir": ".lisan_out/dictionaries/",
"declaration": false,
"watch": true
}
}