Structure your npm scripts better via NODE_ENV
npm install yo-env
Cross-platform supplement for your npm scripts.
// package.json
{
"scripts": {
"start": "yo-env",
/* --- invoked when `NODE_ENV=development` (default). --- */
"start:development": "nodemon --exec babel-node --inspect src/index.js",
/* --- invoked when `NODE_ENV=production`. --- */
"start:production": "node --require esm src/index.js"
}
}
MIT License 2018 © Jim Zhan