- Desire of package.json Script Aliases
I would love if in package.json we could configure aliases for scripts. For example, as an alternative to this:
"scripts": {
"dev": "vite",
"serve": "npm run dev"
}
We could write something like this where serve runs the dev script:
"scripts": {
"dev": "vite",
"serve": "script:dev"
}
Or alternatively, an approach more safely compatible and akin to the introduction of peerDependenciesMeta and bin:
{
"scripts": {
"dev": "vite"
},
"scriptAliases": {
"serve": "dev"
}
}
Having proper alias support avoids hard-coding use of a specific runtime, allows translation, permits people to use the invokers they prefer, helps in establishing conventional script names, and makes migrations in naming easier. Just ending the npm run dev vs npm run serve debate would be worth it.