Configuration
Supported file formats
- a
better-scripts
property in package.json (⭐️ Recommended) scripts.json
(⭐️⭐️ Recommended)
See more formats
better-scripts.json
.better-scriptsrc
.better-scriptsrc.json
.better-scriptsrc.yaml
.better-scriptsrc.yml
.better-scriptsrc.js
.better-scriptsrc.cjs
better-scriptsrc.config.js
better-scriptsrc.config.cjs
Specification
- String
- Array
- Object
scripts.json
{
"dev": "react-scripts start"
}
"
scriptName
": "command
"
scripts.json
{
"dev": ["react-scripts start", "Start a development server"]
}
"
scriptName
": ["command
", "desc
"]
scripts.json
{
"dev": {
"alias": "🌟 Dev",
"command": "react-scripts start",
"desc": "Start a development server",
}
}
Config Object
Property | Type | Description | Required |
---|---|---|---|
scriptName | Script : string | array | object | The key of the Script object | ✅ |
Script Object
Property | Type | Description | Required |
---|---|---|---|
alias | string | 🥳 Displayed name. Defaults to scriptName | |
command | string | The key of the script object | |
desc | describe | description | string | Explain what this script does | |
scripts | Config : object | Nested child scripts. Run step by step | |
prescript | Config : Script | Pre-runs. Same as npm. | |
postscript | Config : Script | Post-runs. Same as npm. | |
env | Env : object | Cross-platform environment virables |
TS Interface
interface UserConfig {
alias?: string;
command?: string;
desc?: string;
description?: string;
describe?: string;
scripts?: UserConfig;
prescript?: Valueof<UserConfig>;
postscript?: Valueof<UserConfig>;
env?: {
[key: string]: string;
};
}