The $npm_execpath
environment variable refers to the build tool, so just replace npm
with the $npm_execpath
:
{
"test": "$npm_execpath run lint && mocha"
}
Both npm test
and yarn test
will work, and will use the appropriate build tool.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…