I am using the WebStorm IDE for Node.js and am on Windows 7.
I got a great answer on here about how to configure my package.json file to support nodemon in development and node in production like so:
{
"name": "ExpressNodeUpAndRunning",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "if [$NODE_ENV == 'production']; then node main.js; else nodemon main.js; fi",
"test": "mocha --reporter spec test"
},
"dependencies": {
"request": "*"
}
}
the problem is that if/else script appears to be a UNIX/Mac script, and I am on a Windows development box. This script will have to work on Windows and on Unix since the production servers I will use will be Unix.
so a work-around would be:
{
"name": "Node_Sports_Lineup",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node main.js",
"start_dev": "nodemon main.js",
"test": "mocha tests"
},
"dependencies": {
...
}
So I need to run "npm start_dev
" instead of "npm start
". But how do I do that with WebStorm?